转载:https://en.opensuse.org/SDB:LAMP_setup
Installing Apache2
First of all, make sure you have root access and enter the following command:
Starting Apache2
To start the apache server, enter the following command:
If you ever want to restart the apache server, use:
or if you want to stop it
To automatically start the apache server after a reboot:
Testing the installation
To check if you apache server works, use you favorite text editor an create the index.html file in the /srv/www/htdocs/ folder with the following content:
<html><body><h1>Welcome to my web site!</h1></body></html>
Enabling public access to the web server
In this state the web server is only accessible as localhost. If you want to give access to it from a remote host, you have to open port http (=80) in the firewall. To do this, edit the /etc/sysconfig/SuSEfirewall2 file and change the line
FW_CONFIGURATION_EXT=""
into
FW_CONFIGURATION_EXT="apache2""
A space should separate elements in that line
After editing you have to restart the firewall using:
Alternatively, you can do this using YaST and selecting Security and Users --> Firewall --> Allowed services and add HTTP server.