Answer the question
In order to leave comments, you need to log in
How can I set permissions for Apache on Ubuntu (Linux)?
We were given the task (at the educational institution where I study) to set up a local server on Ubuntu (standard Apache + MySQL + PHP stack). So far, I've dealt with these three technologies only on Windows, which was quite simple and workable. But things are not so simple with Linux. I was able to compile and install Apache following the instructions on httpd.apache.org, but there was a permissions issue.
All Apache folders are owned by root, which led to the fact that Apache cannot even write its own logs (respectively, it cannot start). I found out what commands can help me change permissions and permissions, but I do not quite understand how I should apply them to Apache directories (I started getting acquainted with Linux relatively recently). Should I create a group for the apache user, the user of the same name, and give the group full access to all Apache directories (removing root rights to these directories) or only to some (retaining root rights to some of these directories)? Do I understand correctly that if I give the apache group access to a directory, then I myself will not be able to create, modify or delete anything in these directories? So I need to add myself to the apache group and then I will get access to these directories?
I'd love to know how Apache would be configured in the real world, but I can't find any good information about it.
Answer the question
In order to leave comments, you need to log in
Apache HTTPD build instructions
install-bindist.sh.in and here
echo "Ready."
echo " +--------------------------------------------------------+"
echo " | You now have successfully installed the Apache @[email protected] |"
echo " | HTTP server. To verify that Apache actually works |"
echo " | correctly you should first check the (initially |"
echo " | created or preserved) configuration files: |"
echo " | |"
echo " | $SR/conf/httpd.conf"
echo " | |"
echo " | You should then be able to immediately fire up |"
echo " | Apache the first time by running: |"
echo " | |"
echo " | $SR/bin/apachectl start "
echo " | |"
echo " | Thanks for using Apache. The Apache Group |"
echo " | www.apache.org |"
echo " +--------------------------------------------------------+"
echo " "
but I can't find any good information about it.
I was able to follow the instructions on httpd.apache.org to compile and install Apache,
When installing Apache in a regular way via apt-get, Apache itself creates the desired group and user.
And he can write logs.
How did you set?
Try to do
sudo apt-get purge apache2 && sudo apt-get autoremove
, Good evening.
Here are a couple of my questions / answers, everything is described in them
How to display text from a file? // install and configure apache2
Access denied to the console controller, how to solve? // access rights, but most likely you won't need
Virtual host configuration example, change the paths to your own.
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName localhost
DocumentRoot /home/slonik/localhost/www
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /home/slonik/localhost/www/>
Options +Indexes +FollowSymLinks -MultiViews
AllowOverride All
Order allow,deny
allow from all
Require all granted
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /home/slonik/localhost/error.log
#AccessLog /home/slonik/localhost/access.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
braynycp - set by 1 script, web muzzle is free, has a lot of not very convenient.
bitrix vm - excellent speed is set only on centos in 1 click, has a console interface (press 1 if press 2 if, enter the domain)
vestacp - also free, too, web muzzle is also set in 1 click
ispconig3 - set by manu handles.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question