A. linux centOS下怎麼配置web伺服器
PS:系統概述
硬碟:130G
分區:兩個分別是根目錄(49G,系統及初始化軟體)和/data(89G,空著的、我計劃放所有網站)
已安裝的程序:
1.vsftp
2.mysql
3.apache
在開始操作之前我們把密碼改一下。。。還有就是本文中出現的《》這個符號都表示不用輸入
passwdroot《設置root密碼》
示例我們把所有網站程序都劃分到/data/web/下,方便以後管理
老闆要求
把在本地開發的php+mysql程序通過FTP架設到web伺服器,並能通過域名正常訪問網站。步驟/方法
第一步:創建FTP
================================================================
chmodgo+rwx/data《給data分配許可權》
cd/data《進入data分區》
mkdirweb《建立web目錄》
chmodgo+rwx/data/web
cd/《回到根目錄,個人操作習慣,可跳過這步》
useradd-s/sbin/nologin-gftp–d/var/www/web/wyh.comjiangge
(注:-s/sbin/nologin是讓其不能登陸系統,-d是指定用戶目錄為/var/www/web/wyh.com
jiangge為ftp用戶名字)
passwdjiangge《設置FTP密碼》
vi/etc/vsftpd/vsftpd.conf《修改FTP配置文件》
註:按一下i進入到編輯模式,修改完後按一下ESC退出編輯模式,再輸入《:wq》(其作用是保存改修改並退出)《:q!》退出不保存《:q》沒有做過修改用這個退出
idle_session_timeout
data_connection_timeout
找到這兩個,,修改其值大於900,如果不修改這個的話,,FTP鏈接很慢
#xferlog_file
找到這個,刪除#。。。作用是記錄FTP的日誌
/etc/init.d/vsftpdrestart《重啟FTP後配置文件才會生效》
到此第一步OK你可用FTP登陸啦!
註:我這配置有這個問題沒解決,登陸報超時,但你耐心的等一會,就會鏈接好,如果有盆友知道解決方法的,請幫解答一下。。。謝謝。。
======================================================================
第三步:配置mysql
==============================================================================
/usr/local/mysql/bin/mysql–uroot-p《登陸mysql,按一下ENTER然後輸入mysql密碼,默認和萬網root密碼一樣》
usemysql;《選擇mysql表》
grantalloncqwebseo_db.*tocqwebseo@localhostidentifiedby'cqwebseomysql';《添加一個數據,有所有許可權,cqwebseo_db為資料庫名,cqwebseo為用戶名,cqwebseomysql為密碼》
flushprivileges;《不用解釋吧,真就度娘一下。》
exit;《這個也不用說吧》
/usr/local/mysql/bin/mysqladmin-uroot-p8y6v8a3c7ushutdown《停止mysql》
/usr/local/mysql/bin/mysqld_safe《啟動mysql》
到此。。就Ok。注意。。注意。。。。。分號分號分號不要忘記了。
/usr/local/mysql/var《資料庫存放目錄》
================================================================================
第二步:配置httpd.conf
=======================================================================
echohi!Thistest!/data/web/cqwebseo.com>index.php《在cwebseo.com裡面建立一個內容為hi!Thistest!的index.php文件》
vi/var/www/conf/httpd.conf《進入主戰場》
按上下鍵,翻到文檔最後,然後加入下列表代碼(不知道怎麼加進的,看第一步的注意事項)
<VirtualHost*:80>
DocumentRoot/data/web/cqwebseo
DirectoryIndexindex.php
[email protected]
ServerNamecqwebseo.com
ServerAliaswww.cqwebseo.com
#ErrorLog/data/web/sanmao/log/error.log
#TransferLog/data/web/sanmao/log/access.log
</VirtualHost>
簡單說一下。。。。。。網上有很多這方面的資料
DocumentRoot/data/web/cqwebseo這個就是網站的決對地址說白就是你分配給他的FTP地址
DirectoryIndexindex.php這個表示網站默認首頁是index.php
[email protected]服務管理員的郵箱
ServerNamecqwebseo.com這個你懂的
ServerAliaswww.cqwebseo.com這個也不需要解釋吧
餘下的兩個被我注釋掉嘍,,,意思是網站的日誌文件存放地
var/www/bin/apachectlrestart重啟apachectl
var/www/bin/apachectlstop停止apachectl
var/www/bin/apachectlstart啟動apachectl
OK到這里。。第二步就完。。。你能輸入網址。。。看到這個目錄啦。。不過有個前題條件。。這個個域名要解析過來了滴哈。。不然的話。。你就不要輸入域名那兩個。。直接用你服務的IP地址訪問也行的。。。。如果你操作正確啦。。就能看到網頁上出現hi!Tistest!
B. centos7怎麼搭建web伺服器
使用護衛神·主機大師,一鍵配置centos下的web伺服器
一鍵安裝apache/nginx+php+mysql+phpmyadmin+ftp
C. at the website和on the website 的區別
at the website和on the website 的區別在於前面的動詞,和不同的介詞構成不同的片語。
D. centos中怎麼刪除mysql資料庫
查看已經安裝的服務
rpm –qa|grep -i mysql
-i 作用是不區分大小寫
yum remove mysql mysql-server mysql-libs compat-mysql51
rm -rf /var/lib/mysql
rm /etc/my.cnf
查看是否還有mysql軟體:
rpm -qa|grep mysql
有的話繼續刪除
可以看到有兩個安裝包
MySQL-server-5.6.19-1.linux_glibc2.5.x86_64.rpm
MySQL-client-5.6.19-1.linux_glibc2.5.x86_64.rpm
刪除這兩個服務(去掉後綴)
rpm –e MySQL-client-5.6.19-1.linux_glibc2.5.x86_64
rpm -e MySQL-server-5.6.19-1.linux_glibc2.5.x86_64
查看殘留的目錄:
whereis mysql
然後刪除mysql目錄:
rm –rf /usr/lib64/mysql
刪除相關文件:
rm –rf /usr/my.cnf
rm -rf /root/.mysql_sercret
最關鍵的:
rm -rf /var/lib/mysql
如果這個目錄如果不刪除,再重新安裝之後,密碼還是之前的密碼,不會重新初始化!
網上查了很久都沒有文章提到這個,最後還是自己摸索找出來的。
卸載完成!怎麼確定是不是真的卸載干凈了呢?
一是看安裝輸出:
如果沒有卸載干凈,安裝server時輸入只有兩行:
[root @localhost opt]# rpm -ivh MySQL-server-5.6.19-1.linux_glibc2.5.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-server ########################################### [100%]
卸載干凈了安裝輸入如下:
[root @localhost opt]# rpm -ivh MySQL-server-5.6.19-1.linux_glibc2.5.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-server ########################################### [100%]
2014-09-23 07:22:43 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-09-23 07:22:43 26041 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-09-23 07:22:43 26041 [Note] InnoDB: The InnoDB memory heap is disabled
2014-09-23 07:22:43 26041 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-09-23 07:22:43 26041 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-09-23 07:22:43 26041 [Note] InnoDB: Using Linux native AIO
2014-09-23 07:22:43 26041 [Note] InnoDB: Using CPU crc32 instructions
2014-09-23 07:22:43 26041 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-09-23 07:22:43 26041 [Note] InnoDB: Completed initialization of buffer pool
2014-09-23 07:22:43 26041 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2014-09-23 07:22:43 26041 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2014-09-23 07:22:43 26041 [Note] InnoDB: Database physically writes the file full: wait...
2014-09-23 07:22:43 26041 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2014-09-23 07:22:43 26041 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2014-09-23 07:22:45 26041 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2014-09-23 07:22:45 26041 [Warning] InnoDB: New log files created, LSN=45781
2014-09-23 07:22:45 26041 [Note] InnoDB: Doublewrite buffer not found: creating new
2014-09-23 07:22:45 26041 [Note] InnoDB: Doublewrite buffer created
2014-09-23 07:22:45 26041 [Note] InnoDB: 128 rollback segment(s) are active.
2014-09-23 07:22:45 26041 [Warning] InnoDB: Creating foreign key constraint system tables.
2014-09-23 07:22:45 26041 [Note] InnoDB: Foreign key constraint system tables created
2014-09-23 07:22:45 26041 [Note] InnoDB: Creating tablespace and datafile system tables.
2014-09-23 07:22:45 26041 [Note] InnoDB: Tablespace and datafile system tables created.
2014-09-23 07:22:45 26041 [Note] InnoDB: Waiting for purge to start
2014-09-23 07:22:45 26041 [Note] InnoDB: 5.6.19 started; log sequence number 0
A random root password has been set. You will find it in '/root/.mysql_secret'.
2014-09-23 07:22:46 26041 [Note] Binlog end
2014-09-23 07:22:46 26041 [Note] InnoDB: FTS optimize thread exiting.
2014-09-23 07:22:46 26041 [Note] InnoDB: Starting shutdown...
2014-09-23 07:22:48 26041 [Note] InnoDB: Shutdown completed; log sequence number 1625977
2014-09-23 07:22:48 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2014-09-23 07:22:48 26065 [Note] InnoDB: Using atomics to ref count buffer pool pages
2014-09-23 07:22:48 26065 [Note] InnoDB: The InnoDB memory heap is disabled
2014-09-23 07:22:48 26065 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-09-23 07:22:48 26065 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-09-23 07:22:48 26065 [Note] InnoDB: Using Linux native AIO
2014-09-23 07:22:48 26065 [Note] InnoDB: Using CPU crc32 instructions
2014-09-23 07:22:48 26065 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-09-23 07:22:48 26065 [Note] InnoDB: Completed initialization of buffer pool
2014-09-23 07:22:48 26065 [Note] InnoDB: Highest supported file format is Barracuda.
2014-09-23 07:22:48 26065 [Note] InnoDB: 128 rollback segment(s) are active.
2014-09-23 07:22:48 26065 [Note] InnoDB: Waiting for purge to start
2014-09-23 07:22:48 26065 [Note] InnoDB: 5.6.19 started; log sequence number 1625977
2014-09-23 07:22:48 26065 [Note] Binlog end
2014-09-23 07:22:48 26065 [Note] InnoDB: FTS optimize thread exiting.
2014-09-23 07:22:48 26065 [Note] InnoDB: Starting shutdown...
2014-09-23 07:22:50 26065 [Note] InnoDB: Shutdown completed; log sequence number 1625987
A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER !
You will find that password in '/root/.mysql_secret'.
You must change that password on your first connect,
no other statement but 'SET PASSWORD' will be accepted.
See the manual for the semantics of the 'password expired' flag.
Also, the account for the anonymous user has been removed.
In addition, you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test database.
This is strongly recommended for proction servers.
See the manual for more instructions.
Please report any problems at http://bugs.mysql.com/
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
New default config file was created as /usr/my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings
最後一段中提示了重要信息,很多人因為不喜歡讀英文,導致接下來不知道怎麼操作!
二就是安裝完成,啟動服務之後
使用命令:「mysql -uroot -p」輸入你之前安裝後設置的密碼,看能不能登錄,如果還可以登錄,說明沒有卸載干凈!
E. on the website 和 at the website 區別
為您解答
這個主要和前面動詞的用法有關
The information is displayed on the website.
Let's see what's new on the website.
On強調在。。。上面,比較實質
Come and visit us at our website
At這里是通過。。。方式的用法
If you would like to take a look at the website ,click here.
這里用at是因為look