Contos配置PHP-MySql-Apache-Nginx

來源:互聯網
上載者:User

標籤:one   生效   mos   -shared   validate   提示   安裝php7   成功   瀏覽器   

Apahce

./configure --prefix=/usr/local/apache --enable-module=most --enable-shared=max
make

su root

make install

運行Apahce
/usr/local/apache/bin/apachectl start

停止Apache
#/usr/local/apache/bin/apachectl stop

開啟瀏覽器
firefox

重啟防火牆
firewall-cmd --reload


幹掉id進程
kill -9 進程id

>>> 關閉防火牆
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall開機啟動
>>> 開啟連接埠
firewall-cmd --zone=public --add-port=80/tcp --permanent

firewall-cmd --reload
----------------------
安裝Apache
yum install httpd
--------------------------
kill -9 關閉的id
-----------------------
重啟apahce
systemctl restart httpd.service
--------------------------
停止apache
systemctl stop httpd.service
---------------------
啟動Apache
systemctl start httpd.service


查看php版本
php -v

安裝php7.0.23版本
http://jingyan.baidu.com/article/7f41ecec2d3c04593d095c24.html

配置php7.0.23
http://blog.csdn.net/leedaning/article/details/45314109
----------------------------------------------------
contos上面安裝mysql
參考網址:http://www.linuxidc.com/Linux/2016-09/135288.htm
# 下載mysql源安裝包
shell> wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
# 安裝mysql源
shell> yum localinstall mysql57-community-release-el7-8.noarch.rpm

檢查mysql源是否安裝成功
shell> yum repolist enabled | grep "mysql.*-community.*"
安裝mysql:shell> yum install mysql-community-server
啟動mysql:shell> systemctl start mysqld
4、開機啟動
shell> systemctl enable mysqld
shell> systemctl daemon-reload


yum方式安裝的mysql的刪除方式

1、yum remove mysql mysql-server mysql-libs compat-mysql51

2、rm -rf /var/lib/mysql
3、rm /etc/my.cnf


mysql修改預設的密碼設定長度
進入到mysql:set global validate_password_policy=0;


更改mysql的密碼
mysql_secure_installation
----------------------------
啟動mysql
systemctl start mysqld
--------------------------------------
開啟mysql
mysql -uroot -p

關閉mysql密碼原則
如果不要求輸入密碼策略,添加my.cnf檔案中添加如下配置禁用即可:
validate_password = off

重新啟動mysql服務使配置生效:
systemctl restart mysqld

開啟防火牆
firewall-cmd --zone=public --add-port=3306/tcp --permanent

重啟防火牆
firewall-cmd --reload
-----------------------------------------------------
ssh安裝相關

查看ssh是否安裝: rpm -qa | grep ssh
線上安裝ssh: yum install openssh-server
啟動ssh: ssh 192.168.87.131
------------------------------------------------------
mysql建立使用者只能訪問特定的資料庫: grant all privileges on pg37.* to [email protected]‘192.168.87.1‘ identified by ‘123456‘;

建立一個pg37資料庫並且是utf8字元集的: create database pg37 character set utf8 collate utf8_bin;
設定防火牆: firewall-cmd --zone=public --add-port=3306/tcp --permanent

重啟防火牆: firewall-cmd --reload

ssh

啟動ssh: ssh 192.168.87.131


查詢已安裝的程式服務: rpm -qa|grep mysql
------------------------------------------------
安裝nginx:

(1)使用yum安裝nginx需要包括Nginx的庫,安裝Nginx的庫

rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
(2)使用下面命令安裝nginx
yum install nginx
(3)啟動Nginx
service nginx start

systemctl start nginx.service


查詢IP地址:
ifconfig -a

卸載mysql-php-apache
查詢已安裝的服務: rpm -qa | grep php
刪除已安裝的服務: yum remove 檔案名稱
用rpm -qa | grep php 查看全部依賴包,再用命令 rpm -e 包名 將它們一一刪除。 刪除時會提示依賴關係,提示那個包就先那個包即可。

終極查漏的方式: httpd -v 還有 which httpd


刪除帶檔案的檔案夾:rm -rf /var/log/httpd

項目目錄:var/www

 

Contos配置PHP-MySql-Apache-Nginx

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.