久久国产成人av_抖音国产毛片_a片网站免费观看_A片无码播放手机在线观看,色五月在线观看,亚洲精品m在线观看,女人自慰的免费网址,悠悠在线观看精品视频,一级日本片免费的,亚洲精品久,国产精品成人久久久久久久

分享

centos7用yum搭建LAMP環(huán)境

 大寶2338 2018-06-25

 

 

用yum快速搭建LAMP平臺(tái)

 

實(shí)驗(yàn)環(huán)境:

復(fù)制代碼
[root@nmserver-7 html]# cat /etc/redhat-release CentOS release 7.3.1611 (AltArch) [root@nmserver-7 html]# uname -aLinux nmserver-7.test.com 3.10.0-514.el7.centos.plus.i686 #1 SMP Wed Jan 25 12:55:04 UTC 2017 i686 i686 i386 GNU/Linux
復(fù)制代碼

1,、安裝apache

  1.1 安裝apache

復(fù)制代碼
[root@nmserver-7 ~]# yum install httpd httpd-devel
復(fù)制代碼

  1.2 啟動(dòng)apache服務(wù)

復(fù)制代碼
[root@nmserver-7 ~]# systemctl start httpd
復(fù)制代碼

  1.3 設(shè)置httpd服務(wù)開(kāi)機(jī)啟動(dòng)

復(fù)制代碼
[root@nmserver-7 ~]# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
復(fù)制代碼

  1.4 查看服務(wù)狀態(tài)

復(fù)制代碼
[root@nmserver-7 ~]# systemctl status httpd
httpd.service - The Apache HTTP Server Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled) Active: active (running) since 五 2017-07-21 17:21:37 CST; 6min ago Docs: man:httpd(8) man:apachectl(8) Main PID: 2449 (httpd) Status: 'Total requests: 11; Current requests/sec: 0; Current traffic: 0 B/sec' CGroup: /system.slice/httpd.service ├─2449 /usr/sbin/httpd -DFOREGROUND ├─2450 /usr/sbin/httpd -DFOREGROUND ├─2451 /usr/sbin/httpd -DFOREGROUND ├─2452 /usr/sbin/httpd -DFOREGROUND ├─2453 /usr/sbin/httpd -DFOREGROUND ├─2454 /usr/sbin/httpd -DFOREGROUND ├─2493 /usr/sbin/httpd -DFOREGROUND ├─2494 /usr/sbin/httpd -DFOREGROUND └─2495 /usr/sbin/httpd -DFOREGROUND7月 21 17:21:35 nmserver-7.test.com systemd[1]: Starting The Apache HTTP Server...7月 21 17:21:36 nmserver-7.test.com httpd[2449]: AH00558: httpd: Could not reliably determine the server's fully q...ssage7月 21 17:21:37 nmserver-7.test.com systemd[1]: Started The Apache HTTP Server.Hint: Some lines were ellipsized, use -l to show in full.
復(fù)制代碼

  1.5 防火墻設(shè)置開(kāi)啟80端口

復(fù)制代碼
[root@nmserver-7 ~]# firewall-cmd --permanent --zone=public --add-service=httpsuccess
[root@nmserver-7 ~]# firewall-cmd --permanent --zone=public --add-service=httpssuccess
[root@nmserver-7 ~]# firewall-cmd --reloadsuccess
復(fù)制代碼

  1.6確認(rèn)80端口監(jiān)聽(tīng)中

復(fù)制代碼
[root@nmserver-7 ~]# netstat -tulp
Active Internet connections (only servers)Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN 1084/sshd tcp 0 0 localhost:smtp 0.0.0.0:* LISTEN 1486/master tcp6 0 0 [::]:ssh [::]:* LISTEN 1084/sshd tcp6 0 0 localhost:smtp [::]:* LISTEN 1486/master tcp6 0 0 [::]:http [::]:* LISTEN 2449/httpd udp 0 0 localhost:323 0.0.0.0:* 592/chronyd udp6 0 0 localhost:323 [::]:* 592/chronyd
復(fù)制代碼

  1.8 查服務(wù)器IP

復(fù)制代碼
[root@nmserver-7 ~]# ip addr
1: lo: mtu 65536 qdisc noqueue state UNKNOWN qlen 1 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever2: ens33: mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:0c:29:56:bc:cf brd ff:ff:ff:ff:ff:ff inet 192.168.8.9/24 brd 192.168.8.255 scope global ens33 valid_lft forever preferred_lft forever inet6 fe80::20c:29ff:fe56:bccf/64 scope link valid_lft forever preferred_lft forever3: bridge0: mtu 1500 qdisc noqueue state DOWN qlen 1000 link/ether ea:89:d5:c7:32:73 brd ff:ff:ff:ff:ff:ff
復(fù)制代碼

  1.9 瀏覽器登陸

 

2、安裝mysql

  2.1安裝mysql

復(fù)制代碼
[root@nmserver-7 ~]# yum install mariadb mariadb-server mariadb-libs mariadb-devel
復(fù)制代碼

 

復(fù)制代碼
root@nmserver-7 ~]# rpm -qa |grep mariamariadb-libs-5.5.52-1.el7.i686mariadb-5.5.52-1.el7.i686mariadb-server-5.5.52-1.el7.i686mariadb-devel-5.5.52-1.el7.i686
復(fù)制代碼

 

  2.2 開(kāi)啟mysql服務(wù),,并設(shè)置開(kāi)機(jī)啟動(dòng),,檢查mysql狀態(tài)

復(fù)制代碼
[root@nmserver-7 ~]# systemctl start mariadb 
[root@nmserver-7 ~]# systemctl enable mariadb
 Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.[root@nmserver-7 ~]# systemctl status mariadb ● mariadb.service - MariaDB database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled) Active: active (running) since 六 2017-07-22 21:19:20 CST; 21s ago Main PID: 9603 (mysqld_safe) CGroup: /system.slice/mariadb.service ├─9603 /bin/sh /usr/bin/mysqld_safe --basedir=/usr └─9760 /usr/libexec/mysqld --basedir=/usr --datadir=/v...7月 22 21:19:15 nmserver-7.test.com mariadb-prepare-db-dir[9524]: ...7月 22 21:19:15 nmserver-7.test.com mariadb-prepare-db-dir[9524]: ...7月 22 21:19:15 nmserver-7.test.com mariadb-prepare-db-dir[9524]: ...7月 22 21:19:15 nmserver-7.test.com mariadb-prepare-db-dir[9524]: ...7月 22 21:19:15 nmserver-7.test.com mariadb-prepare-db-dir[9524]: ...7月 22 21:19:15 nmserver-7.test.com mariadb-prepare-db-dir[9524]: ...7月 22 21:19:15 nmserver-7.test.com mariadb-prepare-db-dir[9524]: ...7月 22 21:19:16 nmserver-7.test.com mysqld_safe[9603]: 170722 21...7月 22 21:19:16 nmserver-7.test.com mysqld_safe[9603]: 170722 21...7月 22 21:19:20 nmserver-7.test.com systemd[1]: Started MariaDB ...
復(fù)制代碼

 

復(fù)制代碼
[root@nmserver-7 ~]# netstat -tulp
Active Internet connections (only servers)Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN 1084/sshd tcp 0 0 0.0.0.0:mysql 0.0.0.0:* LISTEN 9760/mysqld tcp6 0 0 [::]:ssh [::]:* LISTEN 1084/sshd tcp6 0 0 [::]:http [::]:* LISTEN 2449/httpd udp 0 0 localhost:323 0.0.0.0:* 592/chronyd udp6 0 0 localhost:323 [::]:* 592/chronyd
復(fù)制代碼

  2.3 數(shù)據(jù)庫(kù)安全設(shè)置

復(fù)制代碼
[root@nmserver-7 ~]# mysql_secure_installation
 NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!In order to log into MariaDB to secure it, we'll need the currentpassword for the root user. If you've just installed MariaDB, andyou haven't set the root password yet, the password will be blank,so you should just press enter here.Enter current password for root (enter for none): OK, successfully used password, moving on...Setting the root password ensures that nobody can log into the MariaDBroot user without the proper authorisation.Set root password? [Y/n] yNew password: Re-enter new password: Password updated successfully!Reloading privilege tables.. ... Success!By default, a MariaDB installation has an anonymous user, allowing anyoneto log into MariaDB without having to have a user account created forthem. This is intended only for testing, and to make the installationgo a bit smoother. You should remove them before moving into aproduction environment.Remove anonymous users? [Y/n] y ... Success!Normally, root should only be allowed to connect from 'localhost'. Thisensures that someone cannot guess at the root password from the network.Disallow root login remotely? [Y/n] n ... skipping.By default, MariaDB comes with a database named 'test' that anyone canaccess. This is also intended only for testing, and should be removedbefore moving into a production environment.Remove test database and access to it? [Y/n] y - Dropping test database... ... Success! - Removing privileges on test database... ... Success!Reloading the privilege tables will ensure that all changes made so farwill take effect immediately.Reload privilege tables now? [Y/n] y ... Success!Cleaning up...All done! If you've completed all of the above steps, your MariaDBinstallation should now be secure.Thanks for using MariaDB!
復(fù)制代碼

 

  2.4 登陸數(shù)據(jù)庫(kù)測(cè)試

復(fù)制代碼
[root@nmserver-7 ~]# mysql -uroot -p
Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 11Server version: 5.5.52-MariaDB MariaDB ServerCopyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]> show databases;+--------------------+| Database |+--------------------+| information_schema || mysql || performance_schema |+--------------------+3 rows in set (0.02 sec)MariaDB [(none)]>
復(fù)制代碼

 

3、安裝PHP

  3.1 安裝php

復(fù)制代碼
[root@nmserver-7 ~]# yum -y install php
復(fù)制代碼
復(fù)制代碼
[root@nmserver-7 ~]# rpm -ql php/etc/httpd/conf.d/php.conf/etc/httpd/conf.modules.d/10-php.conf/usr/lib/httpd/modules/libphp5.so/usr/share/httpd/icons/php.gif/var/lib/php/session
復(fù)制代碼

 

  3.2 將php與mysql關(guān)聯(lián)起來(lái)

復(fù)制代碼
[root@nmserver-7 ~]# yum install php-mysql
[root@nmserver-7 ~]# rpm -ql php-mysql/etc/php.d/mysql.ini/etc/php.d/mysqli.ini/etc/php.d/pdo_mysql.ini/usr/lib/php/modules/mysql.so/usr/lib/php/modules/mysqli.so/usr/lib/php/modules/pdo_mysql.so
復(fù)制代碼

 

  3.3 安裝常用PHP模塊

復(fù)制代碼
[root@nmserver-7 ~]# yum install -y php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel php-bcmath
復(fù)制代碼

 

  3.4 測(cè)試PHP

復(fù)制代碼
[root@nmserver-7 ~]# cd  /var/www/html/
[root@nmserver-7 html]# ls
[root@nmserver-7 html]# pwd
/var/www/html
[root@nmserver-7 html]# vi info.php

<?php
        phpinfo();
?>
~                                                                                        
~                                                                                        
~                                                                                        
~                                                                                        
~                                                                                        
~                                                                                        
~                                                                                        
~        :wq
復(fù)制代碼

 

  3.5重啟apache服務(wù)器

復(fù)制代碼
[root@nmserver-7 html]# systemctl restart http
復(fù)制代碼

  3.6測(cè)試PHP

  在自己電腦瀏覽器輸入 192.168.8.9/info.php,,你可以看到已經(jīng)安裝的模塊,;

  

至此,CentOS7下LAMP環(huán)境搭建好了,!下一步可以安裝zabbix了,!

 

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,,不代表本站觀點(diǎn),。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,,謹(jǐn)防詐騙,。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào),。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多