亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
樓主: 一生有你llx
打印 上一主題 下一主題

[服務應用] Linux服務器配置 [復制鏈接]

論壇徽章:
1
15-16賽季CBA聯(lián)賽之福建
日期:2018-12-10 14:43:45
11 [報告]
發(fā)表于 2018-11-25 08:45 |只看該作者
本帖最后由 一生有你llx 于 2018-11-26 16:45 編輯

Apache支持cgi    
1、打開Apache配置文件httpd.conf,搜索“cgi”,找到下面的一段,去掉“addhandler”前面的“#“,這樣就開啟了Apache的cgi功能
[root@localhost ~]# gedit /etc/httpd/conf/httpd.conf
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
AddHandler cgi-script .cgi

2、cgi的目錄在“/var/www/cgi-bin/”,在這里創(chuàng)建一個測試文件“test.cgi”輸入內(nèi)容如下
[root@localhost ~]# touch /var/www/cgi-bin/test.cgi
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "hello cgi";

3、將“cgi-bin”的權利改為777
[root@localhost ~]# chmod R 777 /var/www/cgi-bin

4、在瀏覽器輸入“127.0.0.1/cgi-bin/test.cgi”可以看到下面的結果
      


做了一個Linux學習的平臺,目前出來一個雛形,各位可以參考使用
鏈接:https://pan.baidu.com/s/1GOLVU2CbpBNGtunztVpaCQ  密碼:n7bk

論壇徽章:
1
15-16賽季CBA聯(lián)賽之福建
日期:2018-12-10 14:43:45
12 [報告]
發(fā)表于 2018-11-26 16:43 |只看該作者
Apache支持ssl
1、檢測是否安裝ssl模塊,如果沒有就安裝
[root@localhost cgi-bin]# rpm -qa | grep mod_ssl           //查看是否安裝ssl模塊
[root@localhost cgi-bin]# yum install -y mod_ssl           //安裝ssl
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile                                 
Complete!
[root@localhost cgi-bin]#

2、修改ssl的配置文件“/etc/httpd/conf.d/ssl.conf”如下,開啟ssl,設置監(jiān)聽端口
[root@localhost ~]# gedit /etc/httpd/conf.d/ssl.conf
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.  
LoadModule ssl_module modules/mod_ssl.so           //開啟ssl功能
# When we also provide SSL we have to listen to the
# the HTTPS port in addition.
Listen 443       //監(jiān)聽的端口

3、修改防火墻配置,開啟對上面端口443的支持
[color=rgb(68, 68, 6]      1)在終端輸入命令“setup”,在彈出的框中選擇“防火墻”,接著選擇“定制”
[color=rgb(68, 68, 6]      
[color=rgb(68, 68, 6]      2)使用空格鍵選中”https“,接著選擇“轉(zhuǎn)發(fā)”
[color=rgb(68, 68, 6]      
[color=rgb(68, 68, 6]     3)選擇“添加“
[color=rgb(68, 68, 6]      
[color=rgb(68, 68, 6]     4)添加端口443,協(xié)議tcp,然后確定
[color=rgb(68, 68, 6]      
[color=rgb(68, 68, 6]     5)回到最初的界面,“確定”
[color=rgb(68, 68, 6]      
     6)重啟防火墻
[root@localhost ~]# service iptables restart
iptables:將鏈設置為政策 ACCEPT:filter nat                [確定]
iptables:清除防火墻規(guī)則:                                 [確定]
iptables:正在卸載模塊:                                   [確定]
iptables:應用防火墻規(guī)則:                                 [確定]
[root@localhost ~]#
     7)重啟apache
[root@localhost ~]# service httpd restart
停止 httpd:                                              [確定]
正在啟動 httpd:httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
                                                          [確定]
[root@localhost ~]#

4、測試
     1)在瀏覽器輸入https://127.0.0.1,注意必須是“https“ ,看到如下結果
      
     2)選擇“我已充分了解”,彈出如下對話框,選擇“確認安全例外”就可以正常訪問
      



論壇徽章:
1
15-16賽季CBA聯(lián)賽之福建
日期:2018-12-10 14:43:45
13 [報告]
發(fā)表于 2018-11-27 09:21 |只看該作者
Apache支持用戶認證
      為了服務器的安全,通常用戶在請求訪問某個文件夾的時候,Apache可以要求用戶輸入有效的用戶名和登錄密碼

1、創(chuàng)建一個測試目錄
[root@localhost cgi-bin]# mkdir /var/www/html/wj

2、開啟認證功能,修改配置文件httpd.conf如下,(將html目錄的配置中none改為all)
[root@localhost ~]# gedit /etc/httpd/conf/httpd.conf
<Directory "/var/www/html">
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
    AllowOverride All          //默認是none,這里改為all
#
# Controls who can get stuff from this server.
#
    Order allow,deny
    Allow from all
</Directory>

3、給需要認證的目錄添加配置,修改httpd.conf文件,添加如下內(nèi)容
<Directory "/var/www/html/wj">     //wj就是我們要認證的目錄
    AllowOverride AuthConfig       //這里必須使用AuthConfig
    Order allow,deny
    Allow from all
</Directory>

4、 給測試目錄設置用戶名和密碼
[root@localhost wj]# htpasswd -c /var/www/html/wj/.htpasswd david      //david就是創(chuàng)建的用戶名
New password:                 //這里需要輸入密碼,下面的是確認密碼
Re-type new password:
Adding password for user david      //創(chuàng)建成功
[root@localhost wj]#

5、創(chuàng)建htaccess文件,并且增加內(nèi)容
[root@localhost wj]# vim .htaccess
AuthUserFile /var/www/html/wj/.htpasswd
AuthName "david"
AuthType Basic
require valid-user

6、重啟Apache服務
[root@localhost wj]# service httpd restart

7、測試,在瀏覽器輸入“127.0.0.1/wj”,可以看到需要輸入密碼
     
[color=rgb(68, 68, 6][size=0.83em]屏幕快照 2018-08-13 下午3.45.24.png (82.25 KB, 下載次數(shù): 0)
下載附件
[color=rgb(153, 153, 153) !important]2018-11-27 09:20 上傳



[color=rgb(68, 68, 6]      


論壇徽章:
1
15-16賽季CBA聯(lián)賽之福建
日期:2018-12-10 14:43:45
14 [報告]
發(fā)表于 2018-11-28 09:56 |只看該作者
安裝jdk
      jdk是運行或者開發(fā)java的必須工具,很多軟件都會依賴jdk,因此必須學會安裝jdk

1、查看當前系統(tǒng)的jdk情況  
[root@localhost wj]# rpm -qa | grep java
tzdata-java-2013g-1.el6.noarch
java-1.6.0-openjdk-1.6.0.0-1.66.1.13.0.el6.i686        //可以看到當前系統(tǒng)已經(jīng)安裝了jdk,但是版本太舊了
java-1.7.0-openjdk-1.7.0.45-2.4.3.3.el6.i686

2、刪除系統(tǒng)jdk包
[root@localhost wj]# yum remove -y java-1.6.0
[root@localhost wj]# yum remove -y java-1.7.0
[root@localhost wj]# rpm -qa | grep java       //查看是否刪除了
tzdata-java-2013g-1.el6.noarch

3、到官網(wǎng)下載最新的jdk包,http://www.oracle.com/technetwork/java/javase/downloads/index.html, 下載的時候注意64位或者32位
      

4、將下載的壓縮包復制到“/usr/local/src/”,解壓
[root@localhost src]# cp /media/sf_data/jdk-10.0.2_linux-x64_bin.tar /usr/local/src/jdk.tar
[root@localhost src]# tar -xvf jdk.tar

5、配置jdk環(huán)境變量,打開“/etc/profile”,在最后面追加如下
[root@localhost src]# gedit /etc/profile
#java environment
export JAVAHOME=/usr/local/src/jdk-10.0.2       //這個路徑就是jdk解壓的路徑
export CLASSPATH=.{JAVAHOME}/jre/lib/rt.jar{JAVAHOME}/lib/dt.jar{JAVAHOME}/lib/tools.jar
export PATH=$PATH{JAVAHOME}/bin

6、刷新profile
[root@localhost src]# source /etc/profile

7、測試jdk,在終端輸入命令“Java -version”
[root@localhost src]# java -version
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) Client VM (build 25.181-b13, mixed mode)
[root@localhost src]#


論壇徽章:
1
15-16賽季CBA聯(lián)賽之福建
日期:2018-12-10 14:43:45
15 [報告]
發(fā)表于 2018-11-29 07:49 |只看該作者
本帖最后由 一生有你llx 于 2018-11-29 07:51 編輯

安裝Tomcat
      Tomcat作為web服務器實現(xiàn)了對servlet和jsp的支持,centos目前不支持yum方式安裝。在使用Tomcat之前,確保你已經(jīng)安裝并配置好了jdk,而且jdk的版本要和tomcat匹配

1、從Tomcat官網(wǎng)下載安裝包(http://tomcat.apache.org/download-70.cgi),直接解壓就可以使用
[root@localhost wj]# tar -xvf tomcat.tar       //直接解壓
[root@localhost wj]# ls
1.c  1.c~ apache-tomcat-9.0.10  tomcat.tar
[root@localhost wj]#

2、進入Apache的bin目錄,執(zhí)行startup.sh就可以啟動Apache
[root@localhost apache-tomcat-9.0.10]# cd /wj/apache-tomcat-9.0.10//bin/
[root@localhost bin]# ./startup.sh
Using CATALINA_BASE:   /wj/apache-tomcat-9.0.10
Using CATALINA_HOME:   /wj/apache-tomcat-9.0.10
Using CATALINA_TMPDIR: /wj/apache-tomcat-9.0.10/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /wj/apache-tomcat-9.0.10/bin/bootstrap.jar:/wj/apache-tomcat-9.0.10/bin/tomcat-juli.jar
Tomcat started.

3、修改防火墻配置,Tomcat默認使用8080端口,需要修改防火墻,開啟對8080端口的支持
      1)在終端輸入命令“setup”,在彈出的框中選擇“防火墻”,接著選擇“定制”
      
     2)使用空格鍵選中”https“、“http”,接著選擇“轉(zhuǎn)發(fā)”
            
     3)選擇“添加“
      
     4)添加端口8080,協(xié)議tcp,然后確定
      
     5)回到最初的界面,“確定”
      
     6)重啟防火墻
[root@localhost ~]# service iptables restart
iptables:將鏈設置為政策 ACCEPT:filter nat                [確定]
iptables:清除防火墻規(guī)則:                                 [確定]
iptables:正在卸載模塊:                                   [確定]
iptables:應用防火墻規(guī)則:                                 [確定]
[root@localhost ~]#
     7)重啟apache
[root@localhost ~]# service httpd restart
停止 httpd:                                              [確定]
正在啟動 httpd:httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
                                                          [確定]
[root@localhost ~]#

4、測試。在瀏覽器輸入https://127.0.0.1:8080,看到如下結果
      

論壇徽章:
1
15-16賽季CBA聯(lián)賽之福建
日期:2018-12-10 14:43:45
16 [報告]
發(fā)表于 2018-11-30 20:13 |只看該作者
安裝mysql
1、檢測是否已安裝mysql
[root@localhost bin]# rpm -qa | grep mysql
mysql-libs-5.1.71-1.el6.i686
[root@localhost bin]

2、安裝mysql和mysql-server
[root@localhost bin]# yum install -y mysql
[root@localhost bin]# yum install -y mysql-server

3、啟動mysql,注意這里的服務名字是“mysqld”
[root@localhost bin]# service mysqld start
shell-init: error retrieving current directory: getcwd: cannot access parent directories: 沒有那個文件或目錄
chdir: error retrieving current directory: getcwd: cannot access parent directories: 沒有那個文件或目錄
初始化 MySQL 數(shù)據(jù)庫: Installing MySQL system tables...
OK
Filling help tables...
OK                                                         [確定]
正在啟動 mysqld:                                          [確定]
[root@localhost bin]#

4、配置MySQL開機啟動
[root@localhost bin]# chkconfig mysqld on
[root@localhost bin]# chkconfig --list mysqld
mysqld         0:關閉  1:關閉  2:啟用  3:啟用  4:啟用  5:啟用  6:關閉
[root@localhost bin]#

5、設置root用戶密碼 ,設置密碼的命令是“mysqladmin -u 用戶名password密碼”
[root@localhost bin]# mysqladmin -u root password 543092   //密碼是543092

6、修改密碼,命令是“mysqladmin -u 用戶名-p password 新密碼”
[root@localhost bin]# mysqladmin -u root -p password 123456     //新密碼123456
Enter password:        //這里要求輸入舊密碼
[root@localhost bin]#

7、mysql配置文件“/etc/my.cnf”
[root@localhost bin]# cat /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql            //數(shù)據(jù)庫文件目錄
socket=/var/lib/mysql/mysql.sock    //socket文件
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
[mysqld_safe]
log-error=/var/log/mysqld.log     //日志文件
pid-file=/var/run/mysqld/mysqld.pid    //進程pid文件

8、修改端口
1)mysql默認的端口是3306,可以使用netstat來查看
[root@localhost bin]# netstat -tunlp | grep mysqld
tcp        0      0 0.0.0.0:3306               0.0.0.0:*                  LISTEN      4339/mysqld         
2)端口在配置文件中修改,打開配置文件,在后面追加一句話”port=xxx”
[root@localhost bin]# gedit /etc/my.cnf
port=3307      
3)重啟myslqd服務,查看端口
[root@localhost bin]# service mysqld restart
shell-init: error retrieving current directory: getcwd: cannot access parent directories: 沒有那個文件或目錄
chdir: error retrieving current directory: getcwd: cannot access parent directories: 沒有那個文件或目錄
^[[A停止mysqld:                                          [確定]
正在啟動mysqld:                                          [確定]
[root@localhost bin]# netstat -tunlp | grep mysqld
tcp        0      0 0.0.0.0:3307               0.0.0.0:*                   LISTEN      4604/mysqld              




論壇徽章:
1
15-16賽季CBA聯(lián)賽之福建
日期:2018-12-10 14:43:45
17 [報告]
發(fā)表于 2018-12-01 16:45 |只看該作者

使用mysql
1、登錄,可以用密碼登錄,也可以不用密碼登錄。命令格式“mysql –u 用戶名 –p 密碼”
[root@localhost src]# mysql -u root p     //有密碼登錄
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
[root@localhost src]# mysql -u root         //無密碼登錄

2、退出,命令“quit”
[root@localhost bin]# quit

3、創(chuàng)建數(shù)據(jù)庫,命令“create database 數(shù)據(jù)庫名稱;”,注意這個命令后面有分號
mysql> create database test1;
Query OK, 1 row affected (0.00 sec)

4、查看數(shù)據(jù)庫,命令“show databases;”
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| test               |
| test1              |
+--------------------+
4 rows in set (0.00 sec)

5、刪除數(shù)據(jù)庫,命令“drop database 數(shù)據(jù)庫名稱;”
mysql> drop database test1;
Query OK, 0 rows affected (0.01 sec)

6、設置權限
mysql允許給某個特定的用戶賦予指定的權利,而且可以指定在某臺機器上使用。Mysql的權限如下
權限
數(shù)據(jù)庫
Table
Column
說明
all privileges


所有權利
alter

增減、刪除、修改列
create

創(chuàng)建數(shù)據(jù)庫、表
delete

刪除行
drop

刪除表、數(shù)據(jù)庫
file


操作文件
index

索引
insert
插入
process


查看線程、連接
reference


創(chuàng)建外鍵
reload


重新加載,擁有此權限可以刷新表
select
選擇
shutdown


關閉
update
更新
usage


無權限,只能連接

1)授權用戶權限,命令格式“grant 權限on 數(shù)據(jù)庫文件to 用戶名@ip identified by ‘密碼’;”。在使用grant的時候,如果用戶不存在,那么久創(chuàng)建用戶。
//給david在本機授權插入功能,密碼123456,只能對test01操作
mysql> grant insert on test01.* to david@localhost identified by '123456';
Query OK, 0 rows affected (0.00 sec)
mysql>
//給david所有權限,在所有的主機都可以操作,而且可以操作任意數(shù)據(jù)庫
mysql> grant all privileges on *.* to david@'%' identified by '123456';
Query OK, 0 rows affected (0.00 sec)
mysql>
2)查看當前數(shù)據(jù)庫所有授權情況,命令“select host,user from mysql.user”
mysql> select host,user from mysql.user;
+-----------------------+-------+
| host                  | user  |
+-----------------------+-------+
| %                     | david |
| 127.0.0.1             | root  |
| localhost             |       |
| localhost             | david |
| localhost             | root  |
| localhost.localdomain |       |
| localhost.localdomain | root  |
+-----------------------+-------+
7 rows in set (0.00 sec)
mysql>
3)查看當前登錄用戶的權利,命令“show grants”
mysql> show grants;
+----------------------------------------------------------------------------------------------------------------------------------------+
| Grants for root@localhost                                                                                                             |
+----------------------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*1256939B1977AFF6C3D114C5594EE354EF363A8B' WITH GRANT OPTION |
+----------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql>
4)查看某個用戶在某臺機器的權限,命令“show grants for user@ip”
mysql> show grants for david@localhost;
+--------------------------------------------------------------------------------------------------------------+
| Grants for david@localhost                                                                                  |
+--------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'david'@'localhost' IDENTIFIED BY PASSWORD '*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9' |
| GRANT INSERT ON `test01`.* TO 'david'@'localhost'                                                            |
+--------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)
mysql>
5)刪除用戶的權限,命令“revoke 權限on  數(shù)據(jù)庫文件  from  user@ip”
mysql> revoke all privileges on *.* from david@'%';
Query OK, 0 rows affected (0.00 sec)
mysql> show grants for david@localhost;        //刪除之后查看一下
+--------------------------------------------------------------------------------------------------------------+
| Grants for david@localhost                                                                                  |
+--------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'david'@'localhost' IDENTIFIED BY PASSWORD '*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9' |
+--------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)
mysql>         
6)刪除用戶,命令“delete from user where user=‘username’”
mysql> use mysql;       //首先要調(diào)用這個命令
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> delete from user where user='david';    //刪除用戶
Query OK, 2 rows affected (0.00 sec)
mysql> select host,user from mysql.user;     //查看用戶
+-----------------------+------+
| host                  | user |
+-----------------------+------+
| 127.0.0.1             | root |
| localhost             |      |
| localhost             | root |
| localhost.localdomain |      |
| localhost.localdomain | root |
+-----------------------+------+
5 rows in set (0.00 sec)
mysql>




[color=rgb(68, 68, 6]做了一個Linux學習的平臺,目前出來一個雛形,各位可以參考使用
鏈接:https://pan.baidu.com/s/1GOLVU2CbpBNGtunztVpaCQ  密碼:n7bk
[color=rgb(68, 68, 6]


論壇徽章:
1
15-16賽季CBA聯(lián)賽之福建
日期:2018-12-10 14:43:45
18 [報告]
發(fā)表于 2018-12-03 15:29 |只看該作者
忘記root密碼
如果不小心忘記了root密碼,那么mysql就不能再登錄了,這時就要重置root密碼才行。通過下面的步驟,我們可以重新設置root密碼。
1、退出mysql
[root@localhost src]# service mysqld stop
停止mysqld:                                             [確定]
[root@localhost src]#

2、進入sql安全模式,命令“/usr/bin/mysqld_safe --skip-grant-table &”
[root@localhost src]#/usr/bin/mysqld_safe --skip-grant-table &
[1] 6332
[root@localhost src]# 180814 10:10:00 mysqld_safe Logging to '/var/log/mysqld.log'.
180814 10:10:00 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

3、無密碼方式登錄,命令“mysql –u root”
[root@localhost src]# mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.71 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>

4、使用mysql,命令“use mysql;”
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql>

5、重設root密碼,命令“update user set password=password (“密碼”) where user=’root’”
mysql> update user set password=password('123456') where user='root';
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3  Changed: 3  Warnings: 0
mysql>

6、刷新
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

7、退出,重新登錄
[root@localhost src]# mysql -u root -p
Enter password:        //這里輸入新密碼
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Sever version: 5.1.71 Source distribution
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>


論壇徽章:
1
15-16賽季CBA聯(lián)賽之福建
日期:2018-12-10 14:43:45
19 [報告]
發(fā)表于 2018-12-04 10:27 |只看該作者
phpMyAdmin 工具
1、檢測是否已安裝php、php-mysql、apache等工具
[root@localhost src]# rpm -qa |grep php
php-cli-5.3.3-26.el6.i686
php-gd-5.3.3-26.el6.i686
php-mysql-5.3.3-26.el6.i686
php-pdo-5.3.3-26.el6.i686
php-5.3.3-26.el6.i686
php-xml-5.3.3-26.el6.i686
php-common-5.3.3-26.el6.i686
[root@localhost src]#

2、到phpMyAdmin官網(wǎng)下載“phpMyAdmin”,https://www.phpmyadmin.net/

3、將下載的軟件拷貝到“/var/www/html/”目錄下,重命名“phpMyAdmin”
[root@localhost down]#tar zxvf phpMyAdmin-4.8.2.tar.gz
[root@localhost down]#cp r phpMyAdmin-4.8.2 /var/www/html/phpMyAdmin

4、修改配置文件“config.sample.inc.php”,將第29行的“cookie”改為“http”
[root@localhost src]# cd /var/www/html/phpMyAdmin/
[root@localhost phpMyAdmin]# gedit config.sample.inc.php
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'http';

5、啟動Apache 和mysql
[root@localhost phpMyAdmin]# service httpd start
正在啟動 httpd:
[root@localhost phpMyAdmin]# service mysqld start
正在啟動mysqld:                                          [確定]
[root@localhost phpMyAdmin]#

6、在瀏覽器輸入“127.0.0.1/phpMyAdmin”,就可以登錄到phpMyAdmin


論壇徽章:
1
15-16賽季CBA聯(lián)賽之福建
日期:2018-12-10 14:43:45
20 [報告]
發(fā)表于 2018-12-04 10:34 |只看該作者
本帖最后由 一生有你llx 于 2019-11-23 10:19 編輯

ftp限制帶寬
      ftp服務器可以設置每個用戶的帶寬,這樣根據(jù)實際需求來分配,更加充分的利用系統(tǒng)資源。帶寬通過參數(shù)“anon_max_rate“和”local_max_rate“來設置,這兩個參數(shù)在配置文件中如果找不到,那么用戶可以在末尾追加。

1、設置匿名用戶帶寬,通過參數(shù)“anon_max_rate”,之后重啟服務
     1)未修改之前的速度
[root@localhost wj]# lftp 192.168.0.113:8765        //匿名登錄
lftp 192.168.0.113:~> cd pub/
lftp 192.168.0.113:/pub> get 1.zip                   //下載文件
[0] get 1.zip &                                                  
    `1.zip' at 322830336 (13%) 65.74M/seta:30s [正接收數(shù)據(jù)]     //速度65M

     2)打開配置文件“/etc/vsftpd/vsftpd.conf“,在末尾追加一句話”anon_max_rate=30000“
[root@localhost ~]#gedit /etc/vsftpd/vsftpd.conf
anon_max_rate=30000      //匿名用戶的帶寬是30kb
     3)重啟服務,測試匿名用戶帶寬
[root@localhost wj]# service vsftpd restart        //重啟服務
關閉vsftpd:                                             [失敗]
為 vsftpd 啟動vsftpd:                                    [確定]

[root@localhost wj]# lftp 192.168.0.113:8765      //匿名登錄,注意端口號之前已經(jīng)修改了
lftp 192.168.0.113:~> cd pub/
lftp 192.168.0.113:/pub> get 1.zip
[0] get 1.zip &                                             
    `1.zip' at 1179648 (0%) 28.0K/s eta:22h [正接收數(shù)據(jù)]      //可以看到這里的下載速度很慢,只有28k

2、設置本機用戶的帶寬,通過參數(shù)“l(fā)ocal_max_rate“ 實現(xiàn) 。這里會限制本地所有的用戶速度
     1)打開配置文件“/etc/vsftpd/vsftpd.conf“,在末尾追加一句話”anon_max_rate=30000“
[root@localhost wj]# lftp david:543092@192.168.0.113:8765     //用戶david登錄,密碼是543092
-rwxrwxrwx    1 0        0        2375494044 Aug 14 06:54 1.zip
lftp david@192.168.0.113:~> get 1.zip                             //下載文件
[0] get 1.zip &                                                
    `1.zip' at 322830336 (13%) 65.74M/s eta:30s [正接收數(shù)據(jù)]   //速度65M
     2)打開配置文件“/etc/vsftpd/vsftpd.conf“,在末尾追加一句話”local_max_rate=30000“
[root@localhost ~]#gedit /etc/vsftpd/vsftpd.conf
local_max_rate=30000      //本地用戶的帶寬是30kb
     3)重啟服務,測試本地用戶帶寬
[root@localhost wj]# service vsftpd restart        //重啟服務
關閉vsftpd:                                             [失敗]
為 vsftpd 啟動vsftpd:                                    [確定]

[root@localhost wj]# lftp david:543092@192.168.0.113:8765     //用戶david登錄,密碼是543092
-rwxrwxrwx    1 0        0        2375494044 Aug 14 06:54 1.zip
lftp david@192.168.0.113:~> get 1.zip                             //下載文件
[0] get 1.zip &                                                
    `1.zip' at 322830336 (13%) 35.0K/s eta:30s [正接收數(shù)據(jù)]   //速度30k

[root@localhost wj]# lftp weijie:123456@192.168.0.113:8765     //用戶david登錄,密碼是123456
-rwxrwxrwx    1 0        0        2375494044 Aug 14 06:54 1.zip
lftp david@192.168.0.113:~> get 1.zip                             //下載文件
[0] get 1.zip &                                                
    `1.zip' at 322830336 (13%) 29.0K/s eta:30s [正接收數(shù)據(jù)]   //速度29k
3、設置指定用戶的帶寬
     1)設置帶寬配置目錄,參數(shù)“user_config_dir“可以指定一個目錄來存放管理帶寬的文件
[root@localhost ~]# gedit /etc/vsftpd/vsftpd.conf
user_config_dir=/etc/vsftpd/rate_limit      //管理用戶帶寬的目錄,這個目錄需要用戶自己創(chuàng)建
     2)設置用戶“weijie“的帶寬,在”rate_limit“目錄下創(chuàng)建文件”weijie“,在文件中添加參數(shù)local_max_rate
[root@localhost wj]# mkdir /etc/vsftpd/rate_limit
[root@localhost wj]# cd /etc/vsftpd/rate_limit/
[root@localhost rate_limit]# touch weijie
[root@localhost rate_limit]# gedit weijie
local_max_rate=30000
     3)重啟vsftpd服務,測試用戶“weijie“用戶”david“的下載速度
[root@localhost wj]# service vsftpd restart        //重啟服務
關閉vsftpd:                                             [確定]
為 vsftpd 啟動vsftpd:                                    [確定]

[root@localhost wj]# lftp david:543092@192.168.0.113:8765        //用戶david登錄
-rwxrwxrwx    1 0        0        2375494044 Aug 14 06:54 1.zip
lftp david@192.168.0.113:~> get 1.zip
[0] get 1.zip &                                                
    `1.zip' at 276234240 (11%) 54.24M/s eta:37s [正接收數(shù)據(jù)]     //速度52M

[root@localhost wj]# lftp weijie:123456@192.168.0.113:8765    //用戶weijie登錄
-rwxrwxrwx    1 0        0        2375494044 Aug 14 07:13 1.zip
lftp weijie@192.168.0.113:~> get 1.zip
[0] get 1.zip &                                             
    `1.zip' at 196608 (0%) 21.4K/s eta:30h [正接收數(shù)據(jù)]         //速度21k



[color=rgb(68, 68, 6]做了一個Linux學習的平臺,目前出來一個雛形,各位可以參考使用
鏈接:https://pan.baidu.com/s/1GOLVU2CbpBNGtunztVpaCQ  密碼:n7bk
[color=rgb(68, 68, 6]

您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復

  

北京盛拓優(yōu)訊信息技術有限公司. 版權所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP