Apache2 not wanting to point to newly edited file location

Discussion in 'Server Operation' started by schwim, Oct 1, 2018.

  1. schwim

    schwim Member HowtoForge Supporter

    Hi there everyone!

    My default apache2 points to /var/www/html and I'd like to point it towards /home/schwim/www/public_html

    So I backed up /etc/apache2/sites-available/000-default.conf and edited to reflect the change:

    Code:
    <VirtualHost *:80>
        ServerAdmin [email protected]
        ServerName domain.com
        ServerAlias www.domain.com
        DocumentRoot /home/schwim/www/public_html
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
    </VirtualHost>
    

    Saved the file and restarted apache2 But now all the page requests are refused except for phpMyAdmin.

    If I visit my phpMyAdmin install, via domain.com/phpmyadmin, this resolves correctly. That seems to have been setup during the lamp stack install and I can't seem to figure out why that works but my root directory won't.

    Here's my old .conf:

    Code:
    <VirtualHost *:80>
            ServerAdmin webmaster@localhost
            DocumentRoot /var/www/html
            ErrorLog ${APACHE_LOG_DIR}/error.log
            CustomLog ${APACHE_LOG_DIR}/access.log combined
    </VirtualHost>
    
    # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
    
    Can someone tell me what I need to do to get apache to point the default connection to /home/schwim/www/public_html?

    Thanks for your time!
     
  2. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Did you give permission e.g. chmod 755 on that targeted directory?
     
  3. Frankenstein

    Frankenstein Member

    and dont forget to chown -R www-data:www-data /path/to/your/new/directory
     

Share This Page