Linux server integrated application configuration note Lite version

Source: Internet
Author: User
Linux server integrated application configuration notes Lite version-Linux Enterprise Application-Linux server application information, the following is a detailed description. (Author: John) Final Goal: To run two sites. Each site has a user who can upload files through ftp. Configure dns to access the site with a domain name.
Configuration ideas:
1. Create two sites, vhost1 and vhost2, to store the files of the two websites.
2. Create two users a1 and a2, pointing to the vhost1 and vhost2 directories respectively.
3. Configure ftp so that a1 and a2 can access vhost1 and vhost2 respectively and upload webpage files.
4. Configure apache, add two virtual hosts vhost1 and vhost2, and use different ip addresses to implement multiple virtual hosts. vhost1 is 192.168.1.20, and vhost2 is 192.168.1.50.
5. Configure DNS, and add two forward resolution vhost1.xiaowu.com to 192.168.1.20, vhost2.xiaowu.com to 192.168.1.50
Lab environment:
Vmware6.03
Redhat9.0 [IP: 192.168.1.20]
Windows2003 [IP: 192.168.1.40]
Procedure:
1
Mkdir/etc/www/vhost1 // create a VM folder
Mkdir/etc/www/vhost2
Cd/etc/www
Chmod 755 vhost1 // change the directory permission to 755
Chmod 755 vhost2
2
Useradd-d/etc/www/vhost1 a1 // Add User a1 and specify the user directory as vhost1
Useradd-d/etc/www/vhost2 a2
Chown a1/etc/www/vhost1 // change the owner of the vhost1 directory to a1
Chown a2/etc/www/vhost2
3
Vi/etc/vsftpd. conf // edit the vsftp configuration file
Anonymous_enable = no
Local_enable = yes
Write_enable = yes
Pam_service_name = vsftpd // service name
Userlist_enable = yes // activate the user list
Userlist_deny = no // the user that does not reject (Allowed Users)
Userlist_file =/etc/vsftpd. user_list // list of permitted users
Chroot_local_user = yes // The directory cannot be changed
Listen = yes
Tcp_wrappers = yes
Vi/etc/vsftpd. user_list // edit the user list and add a1 and a2 users
Service vsftpd start // start the vsftp service
In this case, you can use windows2003 ftpand upload the index.html webpage.
4
Ifconfig ech0: 1 192.168.1.50 netmask 255.255.255.0 up // bind an IP address to the NIC
Vi/etc/httpd/conf/httpd. conf // edit the apache configuration file
KeepAlive on // improves performance
You do not need to change other configuration items. You only need to add two virtual hosts at the end of the file.
// 192.168.1.20 is the IP address of the site to be bound.
DocumentRoot/var/www/vhost1 // website root directory


DocumentRoot/var/www/vhost2

Service httpd start // start the httpd service
In this case, you can use an IP address on windows2003 to access the website.
5
Vi/etc/named. conf // edit the named service configuration file
Add
Zone "xiaowu.com" IN {
Type master;
File "xiaowu.com. zone ";
Allow-update {none ;};
};
Cp/etc/named. local xiaowu.com. zone // create a configuration file for xiaowu.com from the system default document. The file name after xiaowu.com. zone and the file above must be kept
Vi/etc/named/xiaowu.com. zone
$ TTl 86400
@ In soa xiaowu.com. root.xiaowu.com .(
1997022700; Serial
28800; Refresh
14400; Retry
3600000; Expire
86400); Minimum
In ns root.xiaowu.com
Vhost1 in a 192.168.1.20 // Add A record
Vhost2 in a 192.168.1.50
Service named start // start the named service
Set dnsof windows2003to the IP address 192.168.1.20of redhatand upload the completed index.html page to the vhost1 and vhost2 directories respectively. Open the IE browser to access vhost1.xiaowu.com and vhost2.xiaowu.com to check whether the content is correct. Before accessing the service, ping vhost1.xiaowu.com in cmd to check whether dns works properly.
Now, the task configuration is complete.

This is just a simple task in our lab manual. I will sort it out to sort out my ideas and make my memories more profound. I hope it will be helpful for Linux beginners.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.