1. Server and Domain Name
Ali cloud server with a cloud t5, the system is Ubuntu 18
Domain name is Ali cloud rent, to complete the record.
2. build web services
When I use the Apache here
1. Install
apt install apache2 -y
2. Check whether the service is started
systemctl status apache2
Apache common operation command
Start /etc/init.d/apache2 // start the Apache service /etc/init.d/apache2 STOP // stop the Apache service /etc/init.d/apache2 restart // restart the Apache service
3. The server has started, you can now enter the host's IP or public IP access server (domain names later), then access to the Apache default page.
4. Modify the Apache web root directory and the default page.
Modify the root directory
In /etc/apache2/sites-available/000-default.conf file
Modified 000-default.conf configuration
Webmaster @ localhost ServerAdmin DocumentRoot / var / the WWW / HTML // This is the root of the site
Modify the default page
In /etc/apcahce2/mods-available/dir.conf following is the default, indicating that access to the files in the following
<IfModule mod_dir.c>
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
</IfModule>
Add a directory / test inside the while establishing a / test directory in / var / www under / html directory
<IfModule mod_dir.c> DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm /test </IfModule>
Inside create a new file named index.html, when accessing IP / test will be able to access the directory.
5. DNS
Ali cloud, domain management console page, configure domain names and IP binding.
This time can not access the site through the domain name, but also the need for ICP for the record, you can submit a variety of information waiting to complete.
via
Create your own personal website (a)