Centos-Build a lamp running environment & Webmin

Source: Internet
Author: User
Tags apache php gpg mysql backup

Take the centos 5.8 32-bit system as an example.

Install centos RPM Signing Key

You need to install centos RPM to sign the key. For security reasons, this key is not installed when the basic system is installed. In this way, you can install the key on your system only after verifying its authenticity. Rpm has the ability to obtain a key from a centos image:Reference: Where can I obtain the Signing Key of the centos component?

 
Rpm -- import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka

 

Add external source

Because the basic source MySQL and PHPProgramOld, So we add a new external source.

 
VI/etc/yum. Repos. d/CentOS-Base.repo

Add the following information at the bottom:

[Utterramblings] Name=Jason's utter ramblings repobaseurl= Http://www.jasonlitka.com/media/EL$ Releasever/$ Basearch/Enabled= 1Gpgcheck= 1Gpgkey= Http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka

 

Install Apache

Apache is installed in centos by default. You can run the following command on the terminal to start the Apache server:

 
Apachectl start

The restart command is as follows:

 
Apachectl startapachectl stopapachectl restart

The default configuration file path is:

 
/Etc/httpd/CONF/httpd. conf

The default path for storing webpage files is:

 
/Var/www/html/

* If your server does not have Apache installed, see the following command to install Apache:

 
Yum install httpdchkconfig-- Levels 235Httpd on/Etc/init. d/httpd start

 

Install MySQL

Run the yum program to install MySQL

 
Yum install MySQL mysql-Server

Add MySQL to the startup Item (MySQL will be automatically started when the system starts) and start the MySQL server immediately:

 
Chkconfig -- levels 235Mysqld on/Etc/init. d/mysqld start

Set the MySQL Root Account password:

 
Mysql_secure_installation

Shell interaction:

Note: running all parts of this script is recommended for all MySQL servers in production use! Please read each step carefully! In order to log into MySQL to secure it, we'll need the currentpassword for the root user. if you 've just installed MySQL, andyou haven' t set the root password yet, the password will be blank, so you shoshould just press enter here. enter current password for root (enter for none): OK, successfully used password, moving on... setting the root password ensures that nobody can log into the mysqlroot user Without the proper authorisation. Set root password? [Y/n] <-- enternew password: <-- your MySQL Root Password re-enter new password: <-- your MySQL Root Password updated successfully! Reloading privilege tables... success! By default, a MySQL installation has an anonymous user, allowing anyoneto log into MySQL without having to have a user account created forthem. this is intended only for testing, and to make the installationgo a bit smoother. you shoshould remove them before moving into AProduction environment. remove anonymous users? [Y/n] Y <-- Enter # Delete anonymous users?... Success! Normally, root shoshould only be allowed to connect from 'localhost'. thisensures that someone cannot guess at the root password from the network. disallow root login remotely? [Y/n] n <-- Enter # remote connection not allowed?... Success! By default, MySQL comes with a database named 'test' that anyone canaccess. this is also intended only for testing, and shocould be removedbefore moving into a production environment. remove test database and access to it? [Y/n] Y <-- Enter # delete a test database? -Dropping test database... success! -Removing privileges on Test Database ...... success! Reloading the privilege tables will ensure that all changes made so farwill take effect immediately. Reload privilege tables now? [Y/n] Y <-- Enter # refresh the permission table immediately?... Success! Cleaning up... all done! If you 've completed all of the above steps, your mysqlinstallation shoshould now be secure. Thanks for using MySQL!

Here I have set up to allow MySQL remote connection, so I need to restart the MySQL server:

 
/Etc/init. d/mysqld restart

The default configuration file path for MySQL is

 
/Etc/My. CNF

 

Install PHP

Run the following command to install the PHP and Apache PHP modules:

 
Yum install PHP

Install related modules using PHP to support MYSQL: To enable PHP to support MySQL, we can install the PHP-mysql package; you can also install other PHP modules;

You can use the following command to search for available PHP modules:

 
Yum search PHP

Select the required modules for installation:

 
Yum install PHP-mysql PHP-common PHP-mbstring PHP-Gd PHP-imap PHP-ldap php-odbc php-pear PHP-xml php-xmlrpc php-pdo php-mcrypt

Restart Apache now:

 
Apachectl restart

 

Install Webmin

Webmin is currently the most powerful web-based UNIX system management tool. The Administrator accesses various management functions of Webmin through a browser and completes corresponding management actions.

Download the Webmin RPM package

 
Wget http://prdownloads.sourceforge.net/webadmin/webmin-1.580-1.noarch.rpm

Go to the official website to check whether the link is the latest version. Webmin download

Install Webmin

 
Rpm-u webmin-1.550-1.noarch.rpm

* The following error occurs on my machine:

 
Header V3 DSA Signature: nokey, key ID 11f63c51

The solution is as follows:Refer to Linux header V3 DSA Signature: nokey, key ID error Solution

 
Rpm -- import/etc/pki/rpm-GPG/RPM *Rpm-U webmin-1.550-1.noarch.rpm

Start Webmin in the terminal command line

 
/Etc/rc. d/init. d/Webmin start

Access Webmin through a browser. If your IP address is 192.168.100.100, the URL for accessing Webmin is http: // 192.168.100.100: 10000, the username is root, and the password is the root password.

 

Refer:

Centos 5.x Yum install lamp (Apache + MySQL + PHP)

Install the free Host Control Panel Webmin on centos 5

Linux header V3 DSA Signature: nokey, key ID error Solution

Install Webmin in centos

 

 

the lamp runtime environment has been set up here. For MySQL backup, see centos-mysql backup shell script

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.