How to install Zhimeng CMS on a Linux server and cms_PHP on a linux server

Source: Internet
Author: User
On the Linux server, install Zhimeng CMS and the linux server Zhimeng cms. Install Zhimeng CMS on a Linux server. step 1 of the installation of cms on the linux server: configure the firewall (by default, ports 80 and 3306 are access denied and configured on the firewall ): 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

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 . Reference links
1. http://blog.chinaunix.net/uid-26727991-id-4742248.html

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

Step 1 of firewall installation: configure the firewall (by default, ports 80 and 3306 are access denied and configured on the firewall ):...

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.