日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > windows >内容正文

windows

网校及论坛系统搭建

發布時間:2023/12/20 windows 21 豆豆
生活随笔 收集整理的這篇文章主要介紹了 网校及论坛系统搭建 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1.安裝httpd服務

[root@VM_0_11_centos ~]# yum -y install httpd

[root@VM_0_11_centos ~]# systemctl start httpd

2.編輯虛擬主機配置文件【虛擬主機的配置文件: 指揮httpd這個服務怎么去工作】

[root@VM_0_11_centos ~]# cd /etc/httpd

[root@VM_0_11_centos httpd]# ls

conf 【存的是主配置文件】 conf.d【存的是虛擬主機配置文件】 ?conf.modules.d ?logs ?modules ?run

[root@VM_0_11_centos httpd]# cd conf.d

[root@VM_0_11_centos conf.d]# vim wordpress.conf

寫如下內容:
<VirtualHost *:80> #所有IP過來訪問我的80都可以接受
? ? ? ? ServerName www.wordpress1.com #域名
? ? ? ? DocumentRoot /var/www/wordpress #網站主目錄
</VirtualHost>


<Directory "/var/www/wordpress"> #對于目錄的權限設置
? ? ? ? Require all granted

</Directory>


[root@VM_0_11_centos conf.d]# vim edusoho.conf

寫如下內容:

使用末行模式:r wordpress.conf 【讀取這個文件】

然后更改:% s/wordpress/edusoho/g?

:% s/1/2/g

注:這個edusoho很特殊,它的網頁主目錄是在/var/www/edusoho/web 下所以這里還要手動添加一下

[root@VM_0_11_centos conf.d]# httpd -t 【檢查語法】

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message 【需要更改主配置的一律不管】
Syntax OK 【表示沒問題】

?3.新建網站主目錄

[root@VM_0_11_centos conf.d]# mkdir /var/www/wordpress

[root@VM_0_11_centos conf.d]# mkdir /var/www/edusoho ?【edusoho這個文件本身帶有web目錄,所以不用自己創建】

[root@VM_0_11_centos conf.d]# systemctl restart httpd

4.添加一個測試

[root@VM_0_11_centos conf.d]# cd /var/www/wordpress
[root@VM_0_11_centos wordpress]# ls
[root@VM_0_11_centos wordpress]# echo "this is wordpress" >> index.html
[root@VM_0_11_centos wordpress]# ls
index.html
[root@VM_0_11_centos wordpress]# cat index.html
this is wordpress
[root@VM_0_11_centos wordpress]# cd /var/www/edusoho
[root@VM_0_11_centos web]# ls
[root@VM_0_11_centos web]# echo "this is edusoho" >> index.html
[root@VM_0_11_centos web]# ls
index.html
[root@VM_0_11_centos web]# cat index.html

this is edusoho

因為又對httpd服務進行了修改,所以要再重啟一下httpd服務

[root@VM_0_11_centos web]# systemctl restart httpd

4.添加解析

在電腦C:\Windows\System32\drivers\etc 右鍵用記事本打開hosts在這個文件末行添加

服務器公網IP www.wordpress1.com【虛擬主機域名】

服務器公網IP www.edusoho2.com【虛擬主機域名】

保存

5.在瀏覽器輸入www.wordpress1.com ?顯示網頁主目錄

www.edusoho2.com 顯示網頁主目錄

6.部署數據庫

[root@VM_0_11_centos web]# yum -y install mariadb-server mariadb

[root@VM_0_11_centos web]# systemctl start mariadb

[root@VM_0_11_centos web]# mysqladmin -uroot -p password "密碼"

Enter password: 【回車】

[root@VM_0_11_centos web]# mysql -uroot -p

Enter password:?

MariaDB [(none)]> create database wordpress;
Query OK, 1 row affected (0.00 sec)


MariaDB [(none)]> create database edusoho;

Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> show databases;
+--------------------+
| Database ? ? ? ? ? |
+--------------------+
| information_schema |
| edusoho ? ? ? ? ? ?|
| mysql ? ? ? ? ? ? ?|
| performance_schema |
| test ? ? ? ? ? ? ? |
| wordpress ? ? ? ? ?|
+--------------------+

6 rows in set (0.00 sec)

MariaDB [(none)]> exit

Bye

3.部署php環境

[root@VM_0_11_centos web]# yum -y install php php-cli php-curl【用于php去識別域名,php本身是用來溝通web服務和數據庫的,識別瀏覽器發送過來的域名的】 php-fpm 【產生fast-cgi進程】php-intl php-mcrypt php-mysql php-gd php-mbstring php-xml php-dom gd ?【共12個】

[root@VM_0_11_centos web]# systemctl start php-fpm 【啟動服務,讓其產生fast-cgi線程】

修改 PHP 配置文件【更改一些上傳及內存的限制和時區,因為網校系統需要上傳一些視頻,默認值很小】

[root@VM_0_11_centos web]# vim /etc/php.ini

查找:

/post_max_size 【最大上傳文件大小】8改為1024

/memory_limit ? 【php內存限制】128改為1024

/upload_max_filesize 【upload上傳】2改為1024

/date.timezone 找到兩處,在第二處填寫 亞洲上海【注:時區只有上海,沒有北京】

; http://php.net/date.timezone

;date.timezone = Asia/Shanghai

保存退出

[root@VM_0_11_centos web]# vim /etc/php-fpm.d/www.conf

查找:

/listen.owner?

?找到三行

;listen.owner = nobody
;listen.group = nobody

;listen.mode = 0666

這里需要去掉前面分號

這里介紹一個 vim 的一個高級應用:

停留在第一個要取消的分號上面【按 ctrl+v】【按向下方向鍵】把光標停留在最后一個需要刪除的分號上面,【按d】

此時這三行開頭的分號就都去掉了。

改為的最終形式:
listen.owner = apache 【這個apache用戶在最初安裝 httpd時就創建出來了】
listen.group = apache

listen.mode = 0666

保存退出

如何確定一個用戶在系統中是否存在?

[root@VM_0_11_centos web]# id apache【用戶名】
uid=48(apache) gid=48(apache) groups=48(apache)

[root@VM_0_11_centos web]# systemctl restart php-fpm 【重啟,讓php參數生效】

源碼上線

[root@VM_0_11_centos web]# cd /root

[root@VM_0_11_centos web]# wget http://download.edusoho.com/edusoho-7.5.12.tar.gz 【下載edusoho】

[root@VM_0_11_centos ~]# ls
edusoho-7.5.12.tar.gz

[root@VM_0_11_centos ~]# tar xf edusoho-7.5.12.tar.gz 【解壓】

[root@VM_0_11_centos ~]# ls

edusoho ?edusoho-7.5.12.tar.gz

[root@VM_0_11_centos ~]# cp -rf edusoho/* /var/www/edusoho

[root@VM_0_11_centos web]# wget https://cn.wordpress.org/wordpress-4.9.4-zh_CN.tar.gz

[root@VM_0_11_centos ~]# tar xf wordpress-4.9.4-zh_CN.tar.gz
[root@VM_0_11_centos ~]# ls

edusoho ?edusoho-7.5.12.tar.gz ?wordpress ?wordpress-4.9.4-zh_CN.tar.gz

[root@VM_0_11_centos ~]# cd wordpress
[root@VM_0_11_centos wordpress]# ls
index.php ? ? ? ?wp-blog-header.php ? ?wp-includes ? ? ? ?wp-settings.php
license.txt ? ? ?wp-comments-post.php ?wp-links-opml.php ?wp-signup.php
readme.html ? ? ?wp-config-sample.php ?wp-load.php ? ? ? ?wp-trackback.php
wp-activate.php ?wp-content ? ? ? ? ? ?wp-login.php ? ? ? xmlrpc.php

wp-admin ? ? ? ? wp-cron.php ? ? ? ? ? wp-mail.php


[root@VM_0_11_centos wordpress]# mv wp-config-sample.php wp-config.php


[root@VM_0_11_centos wordpress]# ls
index.php ? ? ? ?wp-blog-header.php ? ?wp-includes ? ? ? ?wp-settings.php
license.txt ? ? ?wp-comments-post.php ?wp-links-opml.php ?wp-signup.php
readme.html ? ? ?wp-config.php ? ? ? ? wp-load.php ? ? ? ?wp-trackback.php
wp-activate.php ?wp-content ? ? ? ? ? ?wp-login.php ? ? ? xmlrpc.php

wp-admin ? ? ? ? wp-cron.php ? ? ? ? ? wp-mail.php

[root@VM_0_11_centos wordpress]# vim wp-config.php

找到這三行:
/** WordPress數據庫的名稱 */
define('DB_NAME', 'database_name_here');


/** MySQL數據庫用戶名 */
define('DB_USER', 'username_here');


/** MySQL數據庫密碼 */
define('DB_PASSWORD', 'password_here');

改為:
/** WordPress數據庫的名稱 */
define('DB_NAME', 'wordpress');


/** MySQL數據庫用戶名 */
define('DB_USER', 'root');


/** MySQL數據庫密碼 */
define('DB_PASSWORD', '數據庫密碼');

保存退出

[root@VM_0_11_centos wordpress]# systemctl restart httpd mariadb php-fpm

[root@VM_0_11_centos wordpress]# cd /root
[root@VM_0_11_centos ~]# ls
edusoho ?edusoho-7.5.12.tar.gz ?wordpress ?wordpress-4.9.4-zh_CN.tar.gz
[root@VM_0_11_centos ~]# cp -rf wordpress/* /var/www/wordpress

[root@VM_0_11_centos ~]# cd /var/www/wordpress
[root@VM_0_11_centos wordpress]# ls
index.html ? ? ? wp-blog-header.php ? ?wp-includes ? ? ? ?wp-signup.php
index.php ? ? ? ?wp-comments-post.php ?wp-links-opml.php ?wp-trackback.php
license.txt ? ? ?wp-config.php ? ? ? ? wp-load.php ? ? ? ?xmlrpc.php
readme.html ? ? ?wp-content ? ? ? ? ? ?wp-login.php
wp-activate.php ?wp-content.php ? ? ? ?wp-mail.php
wp-admin ? ? ? ? wp-cron.php ? ? ? ? ? wp-settings.php
[root@VM_0_11_centos wordpress]# rm index.html

rm: remove regular file ‘index.html’? y

[root@VM_0_11_centos web]# systemctl restart httpd
[root@VM_0_11_centos web]# pwd
/var/www/edusoho
[root@VM_0_11_centos web]# ls
api ?app ?bootstrap ?index.html ?plugins ?README.html ?src ?vendor ?vendor_user ?web
[root@VM_0_11_centos web]# ls
api ?app ?bootstrap ?plugins ?README.html ?src ?vendor ?vendor_user ?web

[root@VM_0_11_centos web]# chown -R apache:apache /var/www/edusoho/* 【-R表示所有的目錄,所有的層級】

[root@VM_0_11_centos web]# systemctl restart httpd php-fpm【網頁還是不能正常呈現】

[root@VM_0_11_centos web]# cd /root
[root@VM_0_11_centos ~]# ls
edusoho ?edusoho-7.5.12.tar.gz ?wordpress ?wordpress-4.9.4-zh_CN.tar.gz
[root@VM_0_11_centos ~]# cd edusoho
[root@VM_0_11_centos edusoho]# ls
api ?app ?bootstrap ?plugins ?README.html ?src ?vendor ?vendor_user ?web
[root@VM_0_11_centos edusoho]# cd web
[root@VM_0_11_centos web]# ls
app_dev.php ?assets ? crossdomain.xml ?favicon.ico ?install ? ? themes
app.php ? ? ?bundles ?customize ? ? ? ?files ? ? ? ?robots.txt
[root@VM_0_11_centos web]# ll
total 48
-rw-r--r-- ?1 501 games 2157 Mar 27 ?2017 app_dev.php
-rw-r--r-- ?1 501 games 1931 Mar 27 ?2017 app.php
drwxr-xr-x ?8 501 games 4096 Jul ?7 15:28 assets
drwxr-xr-x 14 501 games 4096 Jul ?7 15:28 bundles
-rw-r--r-- ?1 501 games ?323 Mar 27 ?2017 crossdomain.xml
drwxr-xr-x ?2 501 games 4096 Jul ?7 15:28 customize
-rw-r--r-- ?1 501 games 4286 Mar 27 ?2017 favicon.ico
drwxrwxrwx ?2 501 games 4096 Mar 27 ?2017 files ? 【權限為777】
drwxr-xr-x ?5 501 games 4096 Jul ?7 15:28 install
-rw-r--r-- ?1 501 games ?105 Mar 27 ?2017 robots.txt

drwxr-xr-x ?6 501 games 4096 Mar 27 ?2017 themes


[root@VM_0_11_centos web]# cd /var/www/edusoho
[root@VM_0_11_centos web]# ls
api ?app ?bootstrap ?plugins ?README.html ?src ?vendor ?vendor_user ?web
[root@VM_0_11_centos web]# cd web
[root@VM_0_11_centos web]# ls
app_dev.php ?assets ? crossdomain.xml ?favicon.ico ?install ? ? themes
app.php ? ? ?bundles ?customize ? ? ? ?files ? ? ? ?robots.txt
[root@VM_0_11_centos web]# ll
total 48
-rw-r--r-- ?1 apache apache 2157 Jul ?7 15:29 app_dev.php
-rw-r--r-- ?1 apache apache 1931 Jul ?7 15:29 app.php
drwxr-xr-x ?8 apache apache 4096 Jul ?7 15:29 assets
drwxr-xr-x 14 apache apache 4096 Jul ?7 15:29 bundles
-rw-r--r-- ?1 apache apache ?323 Jul ?7 15:29 crossdomain.xml
drwxr-xr-x ?2 apache apache 4096 Jul ?7 15:29 customize
-rw-r--r-- ?1 apache apache 4286 Jul ?7 15:29 favicon.ico
drwxr-xr-x ?2 apache apache 4096 Jul ?7 15:29 files ?【權限為755】
drwxr-xr-x ?5 apache apache 4096 Jul ?7 15:29 install
-rw-r--r-- ?1 apache apache ?105 Jul ?7 15:29 robots.txt

drwxr-xr-x ?6 apache apache 4096 Jul ?7 15:29 themes

兩個web中的files權限不同

[root@VM_0_11_centos web]# chmod -R 777 files ?【更改權限】
[root@VM_0_11_centos web]# ll
total 48
-rw-r--r-- ?1 root root 2157 Jul ?7 16:48 app_dev.php
-rw-r--r-- ?1 root root 1931 Jul ?7 16:48 app.php
drwxr-xr-x ?8 root root 4096 Jul ?7 16:48 assets
drwxr-xr-x 14 root root 4096 Jul ?7 16:48 bundles
-rw-r--r-- ?1 root root ?323 Jul ?7 16:48 crossdomain.xml
drwxr-xr-x ?2 root root 4096 Jul ?7 16:48 customize
-rw-r--r-- ?1 root root 4286 Jul ?7 16:48 favicon.ico
drwxrwxrwx ?2 root root 4096 Jul ?7 16:48 files
drwxr-xr-x ?5 root root 4096 Jul ?7 16:48 install
-rw-r--r-- ?1 root root ?105 Jul ?7 16:48 robots.txt
drwxr-xr-x ?6 root root 4096 Jul ?7 16:48 themes

[root@VM_0_11_centos web]# systemctl restart httpd php-fpm

注:

?edusoho比較特殊必須通過 www.edusoho2.com/install/start-install.php訪問

完成...

總結

以上是生活随笔為你收集整理的网校及论坛系统搭建的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。