Friends who have used Debian or Redhat operating systems know that installing apache2 on these two operating systems will automatically create an html folder in the /var/www directory.
But the strange thing is that the suse operating system is not like this. It is created under /srv/www, and the apache2 config file is also divided into several different files.
So there is some content.
Start the apache service
/usr/sbin/rcapache2 start
After visiting the IP address, I saw 403, access denied
The initial feeling is that wwwrun does not have permission to read the file, and then
ls -la /srv/www/htdocs /srv/www
all It shows that it has read permission, so the problem is not there.
I saw someone on the suse forum who had the same problem as me. It was a group of people who tried their best to make suggestions but it didn’t work and crashed.
Later I remembered that when I installed apache2, I only installed one package.
sudo zypper in apache2
Maybe others The configuration file was not downloaded and installed?
(Recommended learning: PHP training)
Then I looked at all the installation packages
sudo zypper se apache2
No matter what, install them all
sudo zypper in apache2 apache2-doc apache2-example-pages apache2-utils apache2-prefork apache2-mod_perl apache2-mod_php5
Start apache2
/usr/sbin/rcapache start
Open the ip address in the browser, it works!
Related recommendations: apache tutorial
The above is the detailed content of How to install and run apache2 on suse operating system. For more information, please follow other related articles on the PHP Chinese website!