


Install Dreamweaver CMS on Linux server, Linux server Dreamweaver cms_PHP tutorial
Install Dreamweaver CMS on Linux server, Linux server Dreamweaver cms
Installation
Step 1: Configure the firewall (By default, ports 80 and 3306 are denied access, configure them on the firewall):
- vi /etc/sysconfig/iptables (Add the following two sentences on the line above "COMMIT")
- -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT (allow port 80 through the firewall)
- -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT (allow port 3306 through the firewall)
Then restart the firewall to make the configuration take effect:
- /etc/init.d/iptables restart
Step 2: Install Apache
Install Apache using the following command:
- yum install httpd
If the following statement appears, it means that Apache has been installed and there is no need to reinstall it:
After installation, restart Apache: /etc/init.d/httpd restart
Then set Apache to start at boot: chkconfig httpd on. (This step eliminates the need to manually start the httpd service every time the server is restarted)
To check the startup status of the httpd service, you can use the command: chkconfig --list httpd (the startup status of httpd at each level will be displayed)
Step 3: Install MySQL
1. Use the following command to install MySQL:
- yum install mysql mysql-server
Similarly, if there is a prompt that it has been installed, it means that MySQL is installed on the system. 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 start at boot: chkconfig mysqld on
Finally, copy the configuration file: cp /usr/share/mysql/my-medium.cnf /etc/my.cnf (there is my.cnf under /etc. cnf file, just overwrite it directly)
2. Use the following command to set the password for the root account
- mysql_secure_installation
Enter the password twice according to the prompts and the setting is successful. Note that during the setup process, you will be prompted whether to delete anonymous users, whether to deny root remote access, whether to delete the test database, etc. These all need to be selected according to your actual situation. Finally, it appears: Thanks for using MySQL!, and the password is set successfully.
Restart MySQL: /etc/init.d/mysqld restart
Step 4: Install PHP
1. Use the following command to install PHP:
- yum install php
Just follow the prompts to install. After installation, restart Apache: /etc/init.d/httpd restart
2. Install the PHP component, which is PHP that supports MySQL
You can use the command: yum search php to view PHP components 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-bcmath php-mhash libmcrypt
After installation, restart Apache: /etc/init.d/httpd restart
Restart MySQL: /etc/init.d/mysqld restart
At this step, AMP in LAMP has been installed, but the web server cannot be accessed at this time, because to access the server, Apache and PHP need to be configured accordingly.
Configuration
Step 1: Configure Apache
Modify the Apache configuration file: vi /etc/httpd/conf/httpd.conf, and find the following line in the file and modify it (to search, you can enter "/the character to be searched for" in the general mode of vi to search ):
ServerTokens OS Modified to: ServerTokens (Do not display the name of the server operating system when an error page appears) (Do not display the Apache version in the error page)
Options Indexes FollowSymLinks Modified to: Options Includes ExecCGI FollowSymLinks (Allow the server to execute CGI and SSI, prohibit directory listing)
#AddHandler cgi-script .cgi Modified to: AddHandler cgi-script .cgi .pl to CGI script running)
AllowOverride None Modify to: AllowOverride All (Allow .htaccess) AddDefaultCharset GB2312 (Add GB2312 as the default encoding)
Options Indexes MultiViews FollowSymLinks Modified to Options MultiViews FollowSymLinks (Do not display the tree directory structure on the browser)
Keepalive OFF modification: Keepalive On (allowed programmed online) 100 Modified to: MaxkeepaliveRequests 1000 ( Increase the number of simultaneous connections)
It is recommended to 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. The location of the following lines that need to be modified can be found through the vi search command:
date.timezone = PRC #Remove the semicolon in front and change it to date.timezone = PRCdisable_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,escape shellcmd,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
#Lists the functions that can be disabled in PHP. If some programs need to use this function, it can be deleted and undisabled.
expose_php=Off
display_errors = OFF #Turn on magic_quotes_gpc to prevent SQL injection
log_errors = On #Record error logs
error_log = / var/log/php/error_log.log #Set the error log storage directory. The file must allow the apache user and group to have write permissions (note that the file /var/log/php/error_log.log must be created before modification. Then modify its properties so that it belongs to the apache user and user group chown apache /var/log/php/error_log.log and chgrp apache /var/log/php/error_log.log)
open_basedir = .:/tmp/
After installation and configuration, the web server has basically been set up and can be accessed.
Test Chapter
Under the directory /var/www/html: cd /var/www/html
Create php file: vi index.phpphpinfo();?>
Then, when you enter the local address in the browser, you can access the index.php web page file you just created.
Note:
The default program directory of apache is: /var/www/html, and webpage files can be accessed here. You need to ensure that this directory belongs to user apache and user group apache.The database directory of MySQL is: /var/lib/mysql
Writing this, LAMP is installed and configured. As long as the browser enters the IP address or domain name of the server, it will be able to access the web page files on the server.
If there are any errors or omissions, you are welcome to point out your comments for revision at any time. Thank you for your support.
Commonly used commands in Linux systems:
1. Common Linux commands
1.1. Permission allocation chmod command
chmod 777 dir/file1.2. Reference link
1. http://blog.sina.com.cn/s /blog_3fe048830100gp0e.html
2. Common operating commands for mysql database
2.1. Modify the MySQL character set
1. Modify my.cnf
vi /etc/my.cnf
in [client] Add
default-character-set=utf8
under [mysqld]. Add
default-character-set=utf8
2. Restart MySQL
service mysqld restart
3. View character set settings
show variables like 'character_set_%';
2.2. Some other setting methods
1. Modify the character set of the database
mysql>use mydb
mysql>alter database mydb character set utf-8;
2. Create a database and specify the character set of the database
mysql>create database mydb character set utf-8;
3. Modify through the 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 database
1. Back up
mysqldump -u root -p voice>voice.sql;
2. Restore
source voice.sql;
mysql -u root -p voice
1.http://blog.chinaunix.net/uid-26727991-id-4742248 .html

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Alipay PHP...

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

Session hijacking can be achieved through the following steps: 1. Obtain the session ID, 2. Use the session ID, 3. Keep the session active. The methods to prevent session hijacking in PHP include: 1. Use the session_regenerate_id() function to regenerate the session ID, 2. Store session data through the database, 3. Ensure that all session data is transmitted through HTTPS.

The enumeration function in PHP8.1 enhances the clarity and type safety of the code by defining named constants. 1) Enumerations can be integers, strings or objects, improving code readability and type safety. 2) Enumeration is based on class and supports object-oriented features such as traversal and reflection. 3) Enumeration can be used for comparison and assignment to ensure type safety. 4) Enumeration supports adding methods to implement complex logic. 5) Strict type checking and error handling can avoid common errors. 6) Enumeration reduces magic value and improves maintainability, but pay attention to performance optimization.

The application of SOLID principle in PHP development includes: 1. Single responsibility principle (SRP): Each class is responsible for only one function. 2. Open and close principle (OCP): Changes are achieved through extension rather than modification. 3. Lisch's Substitution Principle (LSP): Subclasses can replace base classes without affecting program accuracy. 4. Interface isolation principle (ISP): Use fine-grained interfaces to avoid dependencies and unused methods. 5. Dependency inversion principle (DIP): High and low-level modules rely on abstraction and are implemented through dependency injection.

How to debug CLI mode in PHPStorm? When developing with PHPStorm, sometimes we need to debug PHP in command line interface (CLI) mode...

Sending JSON data using PHP's cURL library In PHP development, it is often necessary to interact with external APIs. One of the common ways is to use cURL library to send POST�...

How to automatically set the permissions of unixsocket after the system restarts. Every time the system restarts, we need to execute the following command to modify the permissions of unixsocket: sudo...
