Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
So, I'm trying to change the default user and default doc directory in apache on my Raspberry PI. I've successfully changed the user and group in the /etc/apche2/envvars file, and with that change everything seems to still be fine. The user is a member of the www-data group if that helps. I've then created a new folder in the home/user/ directory, and pointed the /etc/apache2/sites-enabled/000-default.conf file at it. I've put an index.html file in the directory, but when I attempt to browse to the PI, I get a forbidden error. Anyone know what I'm missing? This is the output of ls -l:
Code:
drwxr-xr-x 2 chadianscot chadianscot 4096 Mar 14 15:14 htmldocs
The index.html file has the same permissions as the htmldocs folder.
Last edited by chadianscot; 03-15-2016 at 06:28 AM.
I don't have access to my Pi right now, but can try and offer general Apache help so long...
I assume "chadianscot" is the user you want to run the web server? Can you confirm that your change to the user and group worked, and the server is running as that user? You can do this by looking at the output from:
Code:
ps -ef|grep httpd
There should also be an Apache error log, usually in /var/log/apache2/error_log or /var/log/httpd/error_log. This should tell you what the problem is.
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /home/chadianscot/htmldocs
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.