Mobile app version of vmapp.org
Login or Join
Steve110

: Tell apache to point to a subfolder as default starting point for public What would be the different methods of telling Apache to serve up httpdocs/public instead of httpdocs as the default

@Steve110

Posted in: #Apache #ApacheLogFiles #Htaccess #Redirects #Security

What would be the different methods of telling Apache to serve up httpdocs/public instead of httpdocs as the default starting point?

I want to be able to have my includes and logs directories behind the publicly accessible folder.

I know that htaccess is possible, but I've seen a file before that looked something like httpdocs => public ... I could be off, but it was some kind of pointer.

[httpdocs]
-[includes]
-[logs]
-[public] <-- what's served up to the public
--index.php

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Steve110

1 Comments

Sorted by latest first Latest Oldest Best

 

@Carla537

In your Apache configuration file, find a line with 'DocumentRoot' and modify accordingly.

EDIT:

Regarding your comment, then you're looking for this:

DocumentRoot httpdocs/public/

Though for the virtual-hosts request,

<VirtualHost *:80>
ServerAdmin webmaster@sitename.com
ServerName sitename.com DocumentRoot /var/www/sitename #STILL DOCUMENTROOT!!!
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/sitename/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

ErrorLog /var/log/apache2/error_sitename.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access_sitename.log combined

</VirtualHost>


Though note still, it uses the DocumentRoot directive. You can have as many sites as you want. Modify the paths to match the httpdocs/public directory, and I assume that inside /public/ there will be directories for other virtual hosts?

If this isn't what you wanted, please re-phrase your question.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme