linux site serving static site

Web Services
site architecture LAMP
Linux + Apache + MySQL + PHP
system server program + + + intermediate data management software, software
static site
Apache Apache foundation's official website: www.apache.org
Package name: httpd
service port: 80 / tcp (http) 443 / tcp (https)
profile: /etc/httpd/conf/httpd.conf
child profile: /etc/httpd/conf.d / * conf.
main directory: / var / www / html website source code default location
installation Apache
[root @ localhost ~] # yum -y install httpd installed
[root @ localhost ~] # systemctl start httpd start
[root @ localhost ~] # systemctl status httpd see
[root @ localhost ~] # systemctl enable httpd at startup
[root @localhost ~] # systemctl stop firewalld turn off the firewall
[root @ localhost ~] # setenforce 0 Close SELinux
[root @ localhost ~] # check the version of httpd -v
virtual host www.a.org site settings
1. Prepare the site source code (web) directory

mkdir /var/www/html/a.org

vim /var/www/html/a.org/index.html typing

2. Create a.org website profile

vim /etc/httpd/conf.d/a.org.conf

<VirtualHost *: 80>
a virtual host
ServerName www.a.org
server a name
DocumentRoot /var/www/html/a.org
Note: The root of the website

3. Detection of configuration file syntax to restart the service
# httpd -t
systemctl restart httpd #
www.b.org site settings
1. prepare the site source directory
# mkdir /b.org
# vim /b.org/index.html
b.org.org.org as web content
2. create the b.org website profile
# vim /etc/httpd/conf.d/b.org.conf
enter it in the file content
<VirtualHost *: 80>
ServerName www.b.org
DocumentRoot /b.org

<Directory "/b.org" >
the Require All granted

3. detect configuration file syntax to restart the service
# httpd -t
no error, you can start the server
# systemctl restart httpd
client
Linux client DNS
/ Hosts # vim / etc
10.0.128.118 www.a.org
fill in web server IP
10.0.128.118 www.b.org
fill in web server IP
Linux client test site usability
character test
yum -y install elinks
eLink HTTP: // www.b.org
graphics test
by Firefox browser, two separate visits the Web site address

Published 16 original articles · won praise 0 · Views 539

Guess you like

Origin blog.csdn.net/QAQkira/article/details/104761305