4.
Installing Apache software
tar.gz Source Package 1) decompression
TAR directive –ZXVF Source Package
-ZXF Decompression Parameters
-V Show Progress (normally not written)
Unzip Apache
Switch to httpd after extracting directory
2 ) configuring information such as installation paths
./configure Run Configuration Tool
--prefix = Installation path--enable-so
Writing one:
Two:
by backslash \ (recommended)
3) Make compilation
Enter the make command directly in the current directory (compile the executable exe) 4)makeinstall installation
5 ) Verify whether installation Success
When the browser enters localhost, the first run discovery cannot be displayed and the Apache service must be started if the It works representative installation is successful
Can be started by start or stop or restart | abort | restart
Start with start, as shown in
Open the browser again to verify that the following prompt appears, indicating that the installation was successful.
5. Installing MySQL software 1) unzip MySQL
Tar.gz Source Package
2) Copy source package to /usr/local/mysql
3) create MySQL group and MySQL user
Create a MySQL Group
Create a MySQL user
4 ) Switch to /usr/local/ MySQL folder , install in the following manner
scripts/mysql_install_db--user=mysql
If the following effect occurs: On behalf of initialization success
Switch to the/usr/local/mysql directory and execute the following code
Chown-r Root.
Chown-r MySQL Data
Chgrp-r MySQL.
Bin/mysqld_safe--user=mysql &: Starting a database
5 ) Verify that the database is Installation Successful
If the above prompt indicates successful installation, by default, the root user does not have a password and can log in directly, but this is not safe, how to resolve this issue? 6 ) Set Root password
6. Installation PHP Software 1) Decompression and installation
TAR-ZXVF php-5.2.5.tar.gz
CD php-5.2.5
./configure \
--prefix=/usr/local/php \
--WITH-APXS2=/USR/LOCAL/APACHE/BIN/APXS \: Specify Apache Path
--WITH-MYSQL=/USR/LOCAL/MYSQL \: Specifying the MySQL Path
Make
Make install 2) configuration file
After the installation is complete, open/usr/local/apache/conf/httpd.conf, as shown in the following code, to indicate that the installation was successful:
Now it is still impossible to parse the PHP file, add the following code manually:
Save, restart Apache service
3) Validating PHP code
Writing index.php Code
The results are as follows:
7. Writing test Cases : by PHP Add data to database
1) Create a database shop
2) Create user table Sh_admin
3) Write PHP code
4) Run
8. Leak-checking and vacancy 1)php. ini file configuration
Copy the Php.ini-dist file from the PHP installation directory to/usr/local/php/lib and rename it to PHP.ini
The following prompt appears, indicating that the installation was successful
2) Configuring the Self-starting service
Vi/etc/rc.d/rc.local
/usr/local/apache/bin/apachectl start
/usr/local/mysql/bin/mysqld_safe--user=mysql &
The code is as follows:
Save Exit 3) add soft links to Apache and MySQL
Add a soft link to Apache
In the future, we can enter Apache Start|stop|restart directly at the terminal.
Add a soft link to MySQL
Five , SSH services
L Service: sshd
L Position: Disc 2
L Software: openssh-server-3.9p1-8.rhel4.1
L Configuration:/etc/ssh/sshd_config
Server name: sshd 1, complete file upload and download via ssh
1) Start the SSHD service and check if the firewall allows SSH to pass
2) upload and download via SSH
FTP occupancy port: 21 port
SSH occupied Port: 22 port
FLASHFXP:
WINSCP:
SSH can be logged in with the root administrator, which is not possible with FTP.
3) remote management of Linux via SSH
Putty.exe
Securecrtportable:
Six , remote file Management ( Linux)
SCP Remote file Management (Linux to Linux)
SCP local file Remote file: Upload file
SCP Remote file Local file: Download file
Scp–r Folder folder
Scp–p Port File File
20150309+linux+lamp Installation-02