ubuntu LAMP server can't create new .conf file and configure

5,131

So to do that I just removed the folder and removed the projects.local.conf file from /etc/apache2/sites-available.

You removed the configuration file, but did not disable the site:

sudo a2dissite projects.local
# or
sudo rm /etc/apache2/sites-enabled/projects.local.conf
Share:
5,131

Related videos on Youtube

newuser
Author by

newuser

I am just a beginner in the field of web. I like to know about new technology behind Web Sites and Web Applications.

Updated on September 18, 2022

Comments

  • newuser
    newuser over 1 year

    I have the LAMP server on Ubuntu 14.04. I came to know about the php laravel framework.
    So I just installed laravel by going from this link.

    I just made copy the 000-default.conf file from the path /etc/apache2/sites-available and renamed the file as projects.local.conf and changed the code inside it as the referenced link shows and made changes the hosts file from /etc/hosts as like what the referenced link.

    I went through the total tutorial step by step and everything worked fine. Now I just decided to remove the laravel folder and change the installation path.

    So to do that I just removed the folder and removed the projects.local.conf file from /etc/apache2/sites-available. Now again I just copied the 000-default.conf and renamed the copied file as laravel.dev.conf and made necessary changes as per the link. Like in the laravel.dev.conf

    I made my code like this

    <VirtualHost laravel.dev>
    
        ServerName laravel.dev
        ServerAlias laravel.dev
    
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/projects
    
        <Directory /var/www/projects/>
            Options -Indexes
            DirectoryIndex index.php
            Options Indexes FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>
    
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
    
    </VirtualHost>
    

    sudo a2ensite laravel.dev.conf

    Now when I tried to restart the server by doing sudo service apache2 restart
    It showed me error like this:

    Output of config test was:
    apache2: Syntax error on line 219 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/sites-enabled/projects.local.conf: No such file or directory
    Action 'configtest' failed.
    The Apache error log may have more information.
    

    Whenever I am trying to create a new .conf file and again removing that and doing restart the server . It is showing the error for the .conf file which has been deleted recently.
    I have tried many times but its not working at all.

    So can someone tell me how to solve this issue? Any help and suggestions will be really appreciable. Thanks!