Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation of basic services for computer network management

2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

Installation of basic services for computer network management

Use yum to complete the service installation

_ _ By Nemo (for reference only)

After Notice:Apache was installed, I switched back to bridge mode and installed it with rpm.

First of all, let your virtual machine have a network, so you need to set the network card to nat mode, dial a number on the host, set it up and restart the linux system.

After reboot, open firefox to see if you can surf the Internet. Ok, but the default ip of nat mode is assigned dynamically, so we have to set it as your static student ID number according to the teacher's request. So we have to set it up like this! You can get the gateway IP by going to the vmware virtual machine-- > Edit (editor)-- > Virtual Net Editor (virtual network editor)-- > Vmnet8-- > NAT setting in the NAT option-- > get the gateway IP, and you can also modify it to a C segment IP, such as 172.18.75.1 IP-> App.

Then, go back to your operating system, right-click the upper-right corner of the desktop, the small computer icon, and then left-click Edit Connections

After Apply, open your firefox browser and type www.baidu.com to make sure you can surf the Internet.

Right-click on the desktop to open terminal:

Yum install-y make apr* autoconf automake curl curl-devel gcc gcc-c++ gtk+-devel zlib-devel openssl openssl-devel pcre-devel gd kernel keyutils patch perl kernel-headers compat* cpp glibc libgomp libstdc++-devel keyutils-libs-devel libsepol-devel libselinux-devel krb5-devel libXpm* freetype freetype-devel freetype* fontconfig fontconfig-devel libjpeg* libpng* php-common php-gd gettext gettext-devel ncurses* libtool* libxml2 libxml2-devel patch policycoreutils bison

/ / install compilation tools and library files

It may take a long time, so open a new terminal in the blank space for operation.

Enter the following command to modify the hostname:

Test connectivity between virtual machines and hosts:

Just let it ping twice, and control+z ends ping.

As soon as the task is completed.

2, let's start installing bind:

Using a bind server requires a firewall to open the following ports

UDP 53

TCP 53

TCP 953

Vi / etc/sysconfig/iptables # configure firewall port

-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 53-j ACCEPT

-An INPUT-m state-- state NEW-m udp-p udp-- dport 53-j ACCEPT

-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 953-j ACCEPT

/ etc/init.d/iptables restart / / restart the firewall

Modify the dns of the virtual machine and host:

Reboot, restart.

Mount the CD image under the root directory of disk c.

Rpm-qa | grep bind / / check whether bind has been installed

Rpm-ivh + package installs in turn, you know

Vi / etc/named.conf / / Edit named.Confg configuration file

Wq! / / Save

See the named.localhost file in cd / var/named, cp named.localhost 42.com.zone

Cp named.localhost lbx.com.zone

Vi 42.com.zone

Vi lbx.com.zone

Chown root:named 42.com.zone

Chown root:named lbx.com.zone / / add permissions

Service named restart / / restart the domain name service

Nslookup / / check whether the configuration is successful

[root@localhost named] # nslookup

> server www.42.com

Default server: www.42.com

Address: 172.18.75.42#53

> www.lbx.com

Server:www.42.com

Address:172.18.75.42#53

Name:www.lbx.com

Address: 172.18.75.42

>

3 installation of apache

Vi / etc/sysconfig/iptables # configure firewall port

Add the following rules:

-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 80-j ACCEPT

-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 3306-j ACCEPT

/ etc/init.d/iptables restart / / restart the firewall

/ / cd / usr/local/src

Cp'/ media/LAMP/httpd-2.2.9.tar.gz'

Tar-zxvf httpd-2.2.9.tar.gz

Cd httpd-2.2.9

. / configure

Make

Make install

Make install

Yum install httpd / / install apache

Chkconfig-levels 235 httpd on

Apache is a service, so you can start it by setting the startup level of the service. There is no need for me to say more about what the three levels mean.

/ etc/init.d/httpd start / / start it

Vi / etc/hosts / / domain name registration! :

Ping the domain name again

Mkdir / var/www/html/42 / / create a new home directory

Cd / var/www/html/42 / / enter the directory

Vim index.html / / Edit Home Page

In the same way, create the home directory of your second site

[root@localhost 42] # mkdir / var/www/html/lbx

[root@localhost 42] # cd / var/www/html/lbx

[root@localhost lbx] # vim index.html

Vi / etc/httpd/conf/httpd.conf / / add the definition of virtual host

Httpd-t / / check whether the configuration is correct

Service httpd restart / / restart

Open your Firefox to test:

4 install mysql

Cd / media/LAMP/mysql

Rpm-qa | grep mysql

Rpm-ivh mysql-5.1.61-4.el6.x86_64.rpm

Rpm-ivh mysql-server-5.1.61-4.el6.x86_64.rpm

Rpm-ivh perl-DBD-MySQL-4.013-3.el6.x86_64.rpm

Rpm-ivh perl-DBI-1.609-4.el6.x86_64.rpm

Service mysqld start / / start the database

Netstat-ant

/ / modify the database password

Mysqladmin-u root-p password 123

Mysql-h 127.0.0.1-u root-p

Show databases

/ / create a data table

Create database exam

Use exam

Create table result (id int (11) not null, name char (16), score float (4))

Desc result

/ / insert data

Insert into result values (1,100, "liubingxin")

Select * from result; / / View the result

Install php

Cd'/ media/LAMP/php'

Rpm-ivh php-common-5.3.3-3.el6_2.8.x86_64.rpm

Rpm-ivh php-cli-5.3.3-3.el6_2.8.x86_64.rpm

Rpm-ivh php-5.3.3-3.el6_2.8.x86_64.rpm

Rpm-ivh php-pdo-5.3.3-3.el6_2.8.x86_64.rpm

Rpm-ivh php-mysql-5.3.3-3.el6_2.8.x86_64.rpm

Find /-name libphp5.so

Cd / usr/local/apache2/conf/

Vi httpd.conf

/ usr/local/apache2/bin/apachectl stop

/ usr/local/apache2/bin/apachectl restart

Cd / var/www/html/42

Error: link does not exist, directory problem:

Cd / usr/local/apache2/conf/

Vi httpd.conf

Cd extra/

Vi httpd-vhosts.conf

/ usr/local/apache2/bin/apachectl restart

Let's test it.

Install ftp:

Vi / etc/sysconfig/iptables / / configure firewall

-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 21-j ACCEPT

/ etc/init.d/iptables restart / / restart the firewall

Cd / media/LAMP/

Cp vsftpd-2.2.2-11.el6.x86_64.rpm / root

Cd / root

Rpm-ivh vsftpd-2.2.2-11.el6.x86_64.rpm

Cd / etc/vsftpd/

Service vsftpd start

Netstat-ant

Ftp 172.18.74.42 / / Test whether you can get on, ok, quit and continue

Useradd 42-d / var/www/html/42 / / add users

Passwd 42 / / add a password to this user

one hundred and twenty three

Useradd lbx-d / var/www/html/lbx

Passwd lbx

one hundred and twenty three

Vi vsftpd.conf / / Edit profile allows users to log in as

Cd / var/www/html/

Ll

Chown 42:42-R 42

/ / change the master and group to which you belong

Chown lbx:lbx-R lbx

Service vsftpd restart

Optimize the performance of virtual hosts using ab performance testing software

Ab-c 1-n 100 http://www.42.com/index.php

Install eaccelerator to accelerate php execution efficiency

Slightly:

Attached: the configured virtual machine is for reference only

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report