Use slackware to set up a virtual host Management System (1)

Source: Internet
Author: User
Article Title: Using slackware to set up a virtual host Management System (1 ). Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source. Introduction to virtual hosts

A virtual host uses special hardware and software technologies to divide a real host into several hosts to provide external services. Each virtual host can have an independent domain name and address, provides complete functions such as Internet servers (WWW, FTP, and Email. Virtual Hosts are completely independent from each other and can be managed by users themselves. This can greatly alleviate the shortage of IP addresses and servers on the Internet and reduce the hardware, network maintenance, and communication service costs.
 
The virtual host we set up here uses Slackware Linux as the server and then implements it through Apache's virtual host function. Of course, DNS and FTP must be used together. In this way, as long as the server has one IP address, it can provide web Services for multiple domain names at the same time. Management program we use web-cp, so that users can manage their own domain names and sites.

Set up environment

Because it is an experiment, we use an environment virtualized by VMware.

Server System:
Slackware 10.1
Hardware configuration:A standard pc is enough.
Network requirements:You only need to access the Internet.
Network Environment:Ip address of the machine on which vmware Is Installed: 255.255.000015
Subnet Mask: 255.255.255.0
Gateway: 255.255.255.252
DNS: 202.106.0.20

Install the Slackware System

You only need to follow the default installation. Refer to the following article

  Http://www.slack.cn/uploads/wordpress/slackware10install.pdf

  
Note: For installation and use, it is best to give/home a separate partition or hard disk. I used a Vmware Virtual Machine here, So I separately assigned a hard disk to/home. In practice, you can create a separate partition for/home.

Network settings after installation

1. Set ip address and gateway

Edit the/etc/rc. d/rc. inet1.conf file. If you use putty to remotely log on to slackware, you can right-click and paste the following content to the terminal for execution. The role of the following file is to set the slackware Server IP address to 255.255.255.255.28 gateway to 255.255.255.252

Cat>/etc/rc. d/rc. inet1.conf <"EOF"
#
# This file contains the configuration settings for network interfaces.
# If USE_DHCP [interface] is set to "yes", this overrides any other settings.
# If you don't have an interface, leave the settings null ("").

# Config information for eth0:
IPADDR [0] = "0000000028"
NETMASK [0] = "255.255.255.0"
USE_DHCP [0] = ""
DHCP_HOSTNAME [0] = ""

# Config information for eth1:
IPADDR [1] = ""
NETMASK [1] = ""
USE_DHCP [1] = ""
DHCP_HOSTNAME [1] = ""

# Config information for eth2:
IPADDR [2] = ""
NETMASK [2] = ""
USE_DHCP [2] = ""
DHCP_HOSTNAME [2] = ""

# Config information for eth3:
IPADDR [3] = ""
NETMASK [3] = ""
USE_DHCP [3] = ""
DHCP_HOSTNAME [3] = ""

# Default gateway IP address:
GATEWAY = "zookeeper 255.252"

# Change this to "yes" for debugging output to stdout. Unfortunately,
#/Sbin/hotplug seems to disable stdout so you'll only see debugging output
# When rc. inet1 is called directly.
DEBUG_ETH_UP = "no"
EOF

2. Set the Host Name

My host name isWww.test.com

cat > /etc/HOSTNAME < < "EOF"www.test.comEOF

Chmod 644/etc/Host Name

3. Set the host file

Cat>/etc/hosts <"EOF"
127.0.0.1 localhost
Registry.000028 serv1.test.com serv1
Too many bytes 28 test.com

EOF

Chmod 644/etc/hosts

4. Set DNS

Cat>/etc/resolv. conf <"EOF"
Nameserver 202.106.0.20
EOF

Through the above settings, after the system is restarted, my slackware linux system will be able to access the Internet. This is very important because some software will be downloaded later.

Set inetd

By default, slackware uses inetd to start proftp and other processes. However, these are not suitable for our VM service. We need to disable the inetd startup process through the following settings.

Mv/etc/inetd. conf/etc/inetd. conf. old

Cat>/etc/inetd. conf <"EOF"
# Pop3 stream tcp nowait root/usr/sbin/tcpd/usr/sbin/popa3d
# Auth stream tcp wait root/usr/sbin/in. identd in. identd
#
# Ftp stream tcp nowait root/usr/sbin/tcpd proftpd
# Echo stream tcp nowait root internal
# Echo dgram udp wait root internal
# Discard stream tcp nowait root internal
# Discard dgram udp wait root internal
# Daytime stream tcp nowait root internal
# Daytime dgram udp wait root internal
# Chargen stream tcp nowait root internal
# Chargen dgram udp wait root internal
# Time stream tcp nowait root internal
# Time dgram udp wait root internal
# Telnet stream tcp nowait root/usr/sbin/tcpd in. telnetd
# Comsat dgram udp wait root/usr/sbin/tcpd in. comsat
# Imap2 stream tcp nowait root/usr/sbin/tcpd imapd
# Finger stream tcp nowait nobody/usr/sbin/tcpd in. fingerd-u
# Define at stream tcp nowait nobody/usr/sbin/tcpd/bin/ps-auwwx
# Netstat stream tcp nowait root/usr/sbin/tcpd/bin/netstat-
EOF

Chmod 644/etc/inetd. conf

Restart inetd

/Etc/rc. d/rc. inetd stop
Chmod 444/etc/rc. d/rc. inetd

Start MySQL Service

1. Install the mysql database

su mysqlmysql_install_dbexit
chmod +x /etc/rc.d/rc.mysqld/etc/rc.d/rc.mysqld start
2. Set the root password








Mysql-u root mysql
At the mysql> prompt, enter
update user set password=password(“dbpasswd”) where user=“root”;exit
mysqladmin -u root reload
3. Create a mysql configuration file
Cat>/etc/my. cnf <"EOF"

[Mysqld] datadir =/var/lib/mysqlport = 3306 socket =/var/run/mysql. sock

[Mysql. server] user = mysqlbasedir =/var/lib

[Safe_mysqld] err-log =/var/log/mysqld. logpid-file =/var/run/mysql. pid

EOF

 

Start mysql automatically at startup

Chmod + x/etc/rc. d/rc. mysql


Install various graphics Libraries
1. png

Cd/usr/srcwget http://unc.dl.sourceforge.net/sourceforge/libpng/libpng-1.2.8.tar.gztar-xvzf libpng-1.2.8.tar.gzcd libpng-1.2.8

Cp scripts/makefile. linux makefile

Makemake installmake install-headers


2. JPEG-6b

Cd/usr/srcwget http://www.ijg.org/files/jpegsrc.v6b.tar.gztar-xvzf ready src.v6b.tar.gz

Cd jpeg-6b./configure? Prefix =/usr

Make

Mkdir/usr/manmkdir/usr/man/man1make installmake install-headersmake install-lib




3. FREETYPE

D/usr/srcwget http://ufpr.dl.sourceforge.net/sourceforge/freetype/freetype-2.1.9.tar.gztar-xvzf freetype-2.1.9.tar.gz

Cd/usr/src/freetype-2.1.9./configure? Prefix =/usrmakemake install


4. GD

cd /usr/srcwget http://www.boutell.com/gd/http/gd-2.0.33.tar.gztar -zxf gd-2.0.33.tar.gzcd /usr/src/gd-2.0.33

./configure ?prefix=/usr ?with-png=/usr ?with-freetype=/usr ?with-jpeg=/usr

make

make install

 

 

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.