: 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
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
More posts by @Steve110
1 Comments
Sorted by latest first Latest Oldest Best
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.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.