Install zhimeng CMS on the Linux server and zhimeng cms on the linux Server

Source: Internet
Author: User

Install zhimeng CMS on the Linux server and zhimeng cms on the linux Server

Installation

Step 1: configure the firewall(By default, ports 80 and 3306 are access denied and configured on the firewall ):

  1. Vi/etc/sysconfig/iptables (Add the following two sentences to the previous line of "COMMIT)
  2. -A input-m state -- state NEW-m tcp-p tcp -- dport 80-j ACCEPT (allow port 80 to pass through the firewall)
  3. -A input-m state -- state NEW-m tcp-p tcp -- dport 3306-j ACCEPT (allow port 3306 to pass the firewall)

Restart the firewall to make the configuration take effect:

  1. /Etc/init. d/iptables restart

Step 2: install Apache

 

Run the following command to install Apache:

  1. Yum install httpd

If the following statement is output, it indicates that Apache has been installed and you do not need to reinstall it:

 

After installation, restart Apache:/etc/init. d/httpd restart.

Next, set Apache to boot: chkconfig httpd on. (This step makes it unnecessary for the server to manually start the httpd service every time it is restarted)

To view the startup status of the httpd service, run the command chkconfig -- list httpd to display the startup status of httpd at each level)

Step 3: Install MySQL

1. Run the following command to install MySQL:

  1. Yum install mysql-server

Similarly, if you are prompted that you have installed MySQL, you can skip this step. Otherwise, the system will automatically install MySQL.

 

After the installation is complete, start MySQL:/etc/init. d/mysql start

Set MySQL to boot: chkconfig mysqld on
Finally, copy the configuration file: cp/usr/share/mysql/my-medium.cnf/etc/my. cnf (there is a my. cnf file under/etc, directly overwrite it)

2. Use the following command to set a password for the root account

  1. Mysql_secure_installation

Enter the password twice as prompted. Note: During the configuration process, you will be prompted to delete the anonymous user, whether to reject the root remote access, and whether to delete the database used for testing. You need to select the database based on your actual situation. Thanks for using MySQL !, The password is successfully set.

 

Restart MySQL:/etc/init. d/mysqld restart

Step 4: install PHP

1. Run the following command to install PHP:

  1. Yum install php

 

Follow the prompts to install it. Restart Apache:/etc/init. d/httpd restart after installation.
2. Install the PHP component. PHP supports MySQL.

You can run the command: yum search php to view the PHP component and select the required module for installation:

Yum install php-mysql php-gd libjpeg * php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt

After installation, restart Apache:/etc/init. d/httpd restart.

Restart MySQL:/etc/init. d/mysqld restart

 

In this step, all the packages in LAMP have been installed, but the web server cannot be accessed at this time. To access the server, you also need to configure Apache and PHP.

Configuration

Step 1: Configure Apache

Modify Apache configuration file: vi/etc/httpd/conf/httpd. conf, and search for the following row in the file, and modify it (you can enter "/the character to be searched" in the general mode of vi for search ):

Change ServerTokens OS to: ServerTokens Prod (the Server OS name is not displayed when an error page appears)
ServerSignature On: ServerSignature Off (Apache version is not displayed On the error page)
Options Indexes FollowSymLinks is changed to: Options shortdes ExecCGI FollowSymLinks (allows the server to execute CGI and SSI, and prohibits the list of directories)
# Modify AddHandler cgi-script. cgi to AddHandler cgi-script. cgi. pl (run a CGI script with the extension. pl)
AllowOverride None: AllowOverride All (allow. htaccess)
Adddefadefacharset UTF-8 changed to: adddefadefacharset GB2312 (add GB2312 as the default encoding)

Modify Options Indexes MultiViews FollowSymLinks to Options MultiViews FollowSymLinks (the tree directory structure is not displayed on the browser)
Change DirectoryIndex index.html. var to DirectoryIndex index.html index.htm Default.html Default.htm index. php Default. php index.html. var (set the Default homepage file and add index. php)
Modify KeepAlive Off to KeepAlive On (allow procedural connection)
Modify MaxKeepAliveRequests 100 to MaxKeepAliveRequests 1000 (Increase the number of simultaneous connections)

 

Save the configuration and restart Apache:/etc/init. d/httpd restart.

We recommend that you delete the default test page rm-f/etc/httpd/conf. d/welcome. conf/var/www/error/noindex.html.

Step 2: Configure PHP

Modify the PHP configuration file vi/etc/php. ini. You can use the vi SEARCH Command to find the location of the following lines to be modified:

Date. timezone = PRC # Remove the semicolon and change it to date. timezone = PRC.

Disable_functions = passthru, exec, system, chroot, scandir, chgrp, chown, shell_exec, proc_open, proc_get_status, ini_alter, ini_alter, disconnect, dl, openlog, syslog, readlink, symlink, release, delimiter, delimiter, dll, popen, disk_free_space, checkdnsrr, checkdnsrr, getservbyname, getservbyport, delimiter, posix_getgrnam, posix_getgroups, posix_getlogin, delimiter, delimiter, posix_getpid, delimiter, delimiter, posix_getpwuid, delimiter, posix_getsid, posix_getuid, delimiter, posix_kill, posix_mkfifo, delimiter, posix_setsid, posix_setuid, posix_strerror, posix_times, posix_ttyname, posix_uname

# List functions that can be disabled by PHP. If some programs need this function, they can be deleted and disabled.

Expose_php = Off # disable display of php version information

Display_errors = OFF # Disable Error prompt
Register_globals = OFF # disable registration of global variables
Magic_quotes_gpc = On # enable magic_quotes_gpc to prevent SQL Injection
Log_errors = On # record error logs
Error_log =/var/log/php/error_log.log # Set the directory where error logs are stored. The file must allow write permissions for apache users and groups. (Note that before modification, you must first create the file/var/log/php/error_log.log, and then modify its attributes so that it belongs to apache users and user groups. Chown apache/var/log/php/error_log.log and chgrp apache/var/log/php/error_log.log)

Open_basedir =.:/tmp/# set to allow access to the current directory (that is, the directory where the PHP script file is located) And/tmp/directory, which can prevent php trojans from being cross-site

 

After installation and configuration, the web server is basically set up and can be accessed.

 

Test

Under/var/www/html: cd/var/www/html

Create a php file: vi index. php

<? Php
Phpinfo ();
?>

Then, when entering the local address in the browser, you can access the index. php webpage file you just created.

Note:The default program directory of apache is/var/www/html, where webpage files can be accessed. Make sure that the directory belongs to the user apache and User Group apache.

MySQL database Directory:/var/lib/mysql

 

Here, LAMP is installed and configured. the browser can access the webpage files on the server by entering the Server IP address or domain name.

If there are any mistakes or omissions, you are welcome to point out your suggestions at any time. Thank you for your support.

Common commands in Linux:

 

I. Common Linux commands
1. Permission allocation chmod command
Chmod 777 dir/file
. Reference Links
1. http://blog.sina.com.cn/s/blog_3fe048830100gp0e.html
2. Common mysql database operation commands
2. 1. Modify the MySQL Character Set
1. modify my. cnf
Vi/etc/my. cnf
Add under [client]
Default-character-set = utf8
Add under [mysqld]
Default-character-set = utf8
2. Restart MySQL
Service mysqld restart
3. View Character Set settings
Show variables like 'character _ set _ % ';
2. Other settings
1. Modify the character set of the database
Mysql> use mydb
Mysql> alter database mydb character set UTF-8;
2. Create a database. Specify the character set of the database.
Mysql> create database mydb character set UTF-8;
3. Modify through MySQL Command Line
Set character_set_client = utf8;
Set character_set_connection = utf8;
Set character_set_database = utf8;
Set character_set_results = utf8;
Set character_set_server = utf8;
Set character_set_system = utf8;
Set collation_connection = utf8;
Set collation_database = utf8;
Set collation_server = utf8;
2. 3. Back up and restore the database
1. Backup
Mysqldump-u root-p voice> voice. SQL;
2. Restore
Source voice. SQL;
Mysql-u root-p voice <voice. SQL
. Reference Links
1. http://blog.chinaunix.net/uid-26727991-id-4742248.html

 

Reference: http://www.linuxidc.com/Linux/2012-06/63847.htm

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.