How to create symbolic link to apache document root?

13,857

In sites-available/your-site what have you set for DocumentRoot?

Make it point to /var/www

ServerAdmin webmaster@localhost

    DocumentRoot /var/www
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory /var/www/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
    </Directory> . . .
Share:
13,857

Related videos on Youtube

sameermw
Author by

sameermw

FOSS enthusiast

Updated on September 18, 2022

Comments

  • sameermw
    sameermw over 1 year

    My apache document root locate in /var/www and i created a directory called testwp on /var/www. I changed some privileges

    • sudo chown -R $USER:$USER /var/www/testwp

    • sudo chmod 755 /var/www/testwp

    but i cant access that directory from my web browser http://localhost/testwp and it says

    404 Not Found The requested URL /testwp was not found on this server.

    How can i access like that?

    can i do that? please help me. thanks

  • Ramanan
    Ramanan almost 10 years
    That's why it is not working. Change it to /var/www. Currently http://localhost/testwp refers to /var/www/testwp/testwp and http://localhost refers to /var/www/testwp
  • sameermw
    sameermw almost 10 years
    OMG Thank you so much for the help, it works well