Install apache
+----------------------------------------+
| |
|set configuration file to connect to php|
| + |
| | |
| | Install php module |
| | +----------------+ |
| | | | |
| +-----------> | | |
| | | |
| +----------------+ |
+----------------------------------------+
1. Install apache package
pacman -S apache
2. Start apache
systemctl start httpd
systemctl status httpd
After reboot still enable httpd
systemctl enable httpd
3. Modify web root path
Add following script into /etc/httpd/conf/httpd.conf
DocumentRoot "/home/happy/webs"
<Directory "/home/happy/webs">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options Indexes FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
4. Put webpage into /home/happy/webs
5. [apache][Archlinux] Setting up php for apache
Reference:
1. Installing LAMP (Linux, Apache, MySQL/MariaDB, and PHP/PhpMyAdmin) in Arch Linux
2. Apache HTTP Server
0 意見:
張貼留言