linux 搭建php網站許願牆

來源:互聯網
上載者:User

標籤:

網站素材在:https://i.cnblogs.com/Files.aspx

首先需要搭建本地yum源,詳情參考:

http://www.cnblogs.com/jw35/p/5967677.html

我使用Centos 7  做網站伺服器,Centos 5  存放資料

 

 

先配置centos 7 

配置IP

 vi /etc/sysconfig/network-scripts/ifcfg-eno16777736       #編輯網卡設定檔,eno16777736為網卡名字

 

我Centos 7設定的IP為192.168.100.135

 

yum install httpd -y           #安裝Apache服務yum install php -y             #安裝php服務yum install php-mysql -y       #使php與mysql相串連systemctl stop firewalld.service      #臨時關閉防火牆setenforce 0                                #臨時關閉selinux

將網站檔案上傳到/var/www/html 目錄下

修改 connect.php 檔案

$host="192.168.100.235";          #地址$db_user="aa01";                  #使用者名稱$db_pass="123";                   #密碼$db_name="xyq";                   #庫名

重啟Apache

systemctl restart httpd.service

 

centos 5 配置

 

配置IP

ifconfig eth0 192.168.100.235 255.255.255.0    #給eth0網卡臨時添加IP

service iptables stop      #臨時關閉防火牆

 setenforce 0                #臨時關閉selinux

搭建本地yum源

 

yum install mysql-server -y        #安裝mysqlservice mysqld restart              #重啟mysqlmysql                                      #進入資料庫show databases;                       #查看所有資料庫create user ‘aa01‘@‘192.168.100.135‘ identified by ‘123‘;          #給192.168.100.135建立使用者,即建立的使用者只能在192.168.100.135上登入create database xyq;     #建立xyq資料庫grant all privileges on xyq.* to ‘aa01‘@‘192.168.100.135‘;         #給某個使用者加上指定資料庫的許可權,*代表所有的表use xyq;                   #進入資料庫show tables                #查看錶

然後將SQL語句複製進去

quit          #退出資料庫

 

最終如下

 

linux 搭建php網站許願牆

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.