Linux network Configuration and construction of MySQL, Apache, PHP environment

Source: Internet
Author: User
Tags install php

Linux Network configuration

First Use: ifconfig check the network card

If you have only one L0 NIC, you need to open a eth0 network card

Turn on/off network card: ifconfig NIC name Up/down

Eg:ifconfig eth0 up #打开eth0网卡


Configure IP Address: ifconfig NIC IP netmask Subnet mask

Eg:ifconfig eth0 xxx.xxx.xxx.xxx netmask xxx.xxx.xxx.xxx


Configure default gateway: Route add default GW ' Gateway '

Eg:route Add default GW xxx.xxx.xxx.xxx


Configure DNS server VI/ETC/RESOLV.COMF (after opening there is an example to configure the default DNS to do)

Eg:vi/etc/resolv.comf

ServerName 8.8.8.8.8

Build MySQL Environment:

Install MySQL command: yum-y install MySQL


Installing the MySQL service: Yum install Mysql-server # MANADB


Set MySQL self-boot: chkconfig--levels 235 MySQL on


To set up a MySQL User: mysql_secure_installation

(Set root user password, delete useless user)

Build Apache Environment


Installing apache:yum-y Install httpd


Configure Apache:

Edit/etc/httpd/conf/httpd.conf
Find the following:
#ServerName www.example.com:80
Change to
ServerName localhost:80

Restart Apache service again;

Installing Php:yum install PHP php-mysql php-gd php-imap php-ldap php-mbstring php-odbc php-pear php-xml php-xmlrpc


Restart Apache to make PHP effective


Create a new info.php in the/var/www/html directory (Apache default root directory)

<?php phpinfo ();? >

Test PHP


This article is from the "Creative Pilgrim" blog, so be sure to keep this source http://dearch.blog.51cto.com/10423918/1762894

Linux network Configuration and construction of MySQL, Apache, PHP environment

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.