Install the Dream cms,linux server on Linux server weaving dream cms_php Tutorial

Source: Internet
Author: User
Tags mysql command line

Linux Server install Dream cms,linux server weaving dream cms


Installation article

First Step: Configure the Firewall (By default, ports 80 and 3306 are denied access and are configured on the firewall):

    1. Vi/etc/sysconfig/iptables ( Add the following two sentences on the previous line of "COMMIT")
    2. -A input-m state--state new-m tcp-p TCP--dport 80-j ACCEPT (allow 80 ports via firewall)
    3. -A input-m state--state new-m tcp-p TCP--dport 3306-j ACCEPT (Allow 3306 ports via firewall)

Then reboot the firewall to make the configuration effective:

    1. /etc/init.d/iptables restart

Step Two: Install Apache

Install Apache using the following command:

    1. Yum Install httpd

If the statement shown below shows that Apache is already installed, you do not need to reinstall:

After the installation is complete, restart apache:/etc/init.d/httpd restart

The Apache is then set to boot: Chkconfig httpd on. (This step makes it unnecessary for the server to manually start the httpd service at each reboot)

To view the startup status of the HTTPD service, you can use the command: Chkconfig--list httpd (Displays the httpd start state at each level)

Step three: Install MySQL

1. Install MySQL using the following command:

    1. Yum install MySQL Mysql-server

Similarly, if the prompt has been installed, it means that the system installed MySQL, you can skip this step, otherwise, the system will automatically install MySQL next.

After the installation is complete, start the 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 in/etc, just overwrite it)

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

    1. Mysql_secure_installation

Enter the password 2 times as prompted, and the setting is successful. Note that during the setup process, you will be prompted to delete whether the user is anonymous, whether to deny root remote access, whether to delete the test database, etc., which need to be selected according to their actual situation. Last appeared: Thanks for using mysql!, set password succeeded.

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

Fourth Step: Install PHP

1. Install PHP using the following command:

    1. Yum Install PHP

Follow the prompts to install on the line. Restart APACHE:/ETC/INIT.D/HTTPD after installation restart
2, install PHP components, is PHP support MySQL

You can use the command: Yum search php to view the components of PHP and select the required modules 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-b Cmath Php-mhash Libmcrypt

After installation, restart APACHE:/ETC/INIT.D/HTTPD restart

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

At this point, the amp in lamp has been installed, but the Web server is not accessible at this time, because the server is accessed and the Apache and PHP are configured accordingly.

Configuration Chapter

First step: Configure Apache

Modify the Apache configuration file: vi/etc/httpd/conf/httpd.conf, and look for the following line in the file, make changes (find can enter "/to find characters" in the general mode of VI to find):

Servertokens OS modified to: Servertokens Prod (the name of the server operating system is not displayed when the error page appears)
Serversignature on modified to: Serversignature OFF (the Apache version is not shown in the error page)
Options Indexes followsymlinks modified to: Options includes execcgi followsymlinks (Allow server to execute CGI and SSI, prohibit listing of directories)
#AddHandler cgi-script. CGI modified to: AddHandler cgi-script. cgi. PL (allows CGI scripts with extension. pl to run)
AllowOverride None modified to: allowoverride all (Allow. htaccess)
Adddefaultcharset UTF-8 modified to: Adddefaultcharset GB2312 (add GB2312 as default encoding)

Options Indexes multiviews followsymlinks modified to Options MultiViews FollowSymLinks (does not display the tree structure on the browser)
DirectoryIndex index.html Index.html.var modified to: DirectoryIndex index.html index.htm default.html default.htm index.php default.php Index.html.var (set default home file, add index.php)
KeepAlive Off modified to: KeepAlive on (allow program online)
Maxkeepaliverequests 100 modified to: Maxkeepaliverequests 1000 (Increased number of simultaneous connections)

Save the configuration after you modify it 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 Two: Configure PHP

To modify a PHP configuration file: Vi/etc/php.ini, the following lines that need to be modified can be found through the Find command of VI:

Date.timezone = PRC #把前面的分号去掉, changed to Date.timezone = PRC

Disable_functions = Passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_ Alter,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru, Stream_socket_server, Escapeshellcmd,dll,popen,disk_free_space,checkdnsrr,checkdnsrr,getservbyname,getservbyport,disk_total_space, Posix_ctermid,posix_get_last_error,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_ Getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid, Posix_getppid,posix_getpwnam, Posix_getpwuid, Posix_getrlimit, Posix_getsid,posix_getuid,posix_isatty, Posix_kill,posix_mkfifo,posix_setegid, Posix_seteuid,posix_setgid, Posix_setpgid,posix_setsid,posix_setuid,posix_strerror,posix_times,posix_ttyname, Posix_uname

#列出PHP可以禁用的函数, if some programs need to use this function, you can delete, cancel disable.

expose_php = Off #禁止显示php版本的信息

Display_errors = OFF #关闭错误提示
Register_globals = OFF #关闭注册全局变量
MAGIC_QUOTES_GPC = on #打开magic_quotes_gpc来防止SQL注入
Log_errors = on #记录错误日志
Error_log =/var/log/php/error_log.log #设置错误日志存放目录, the file must allow the Apache user's and group to have write permissions (note that before modifying, the file is created first/var/log/php/error_ Log.log, and then modifies its properties 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/#设置表示允许访问当前目录 (i.e. the directory where the php script files are located) and the/tmp/directory, which prevents the PHP Trojan from crossing the station

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

Test article

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

Create PHP File: VI index.php

Phpinfo ();
?>

Then, when you enter the native address in the browser, you can access the index.php Web page file you just created.

NOTE:Apache's default program directory is:/var/www/html, Web page files can be accessed here. Need to ensure that this directory belongs to the user Apache and user group Apache.

The MySQL database directory is:/var/lib/mysql

Write here, lamp installed configuration, the browser just enter the server's IP address or domain name, you can access to the Server Web page files.

There are errors and omissions in the place, you are welcome to point out any changes, thank you for your support.

Common commands for Linux systems:

First, Linux common commands
1.1. Permission Assignment chmod command
chmod 777 Dir/file
1.2. Reference Links
1.http://blog.sina.com.cn/s/blog_3fe048830100gp0e.html
Second, the MySQL database common operation command
2.1. Modifying 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.2. Some other setup methods
1. Modifying the character set of a database
Mysql>use MyDB
Mysql>alter database mydb character Set utf-8;
2. Create a database character set for a specified database
Mysql>create database mydb character Set utf-8;
3. Modify via 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. Backup RESTORE Database
1. Backup
Mysqldump-u root-p voice>voice.sql;
2. Restore
SOURCE Voice.sql;
Mysql-u root-p Voice <>
2.3. Reference Links
1.http://blog.chinaunix.net/uid-26727991-id-4742248.html

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

http://www.bkjia.com/PHPjc/1134601.html www.bkjia.com true http://www.bkjia.com/PHPjc/1134601.html techarticle Install the Dream cms,linux server on Linux server Weaving Dream CMS Installation First step: Configure the Firewall (by default, ports 80 and 3306 are denied access, 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.