install apache2
$ sudo apt-get update
$ sudo apt-get install apache2
啟動,重啟,停止apache服務(wù)
Task: Start Apache 2 Server /啟動apache服務(wù)
# /etc/init.d/apache2 start
or
$ sudo /etc/init.d/apache2 start
Task: Restart Apache 2 Server /重啟apache服務(wù)
# /etc/init.d/apache2 restart
or
$ sudo /etc/init.d/apache2 restart
Task: Stop Apache 2 Server /停止apache服務(wù)
# /etc/init.d/apache2 stop
or
$ sudo /etc/init.d/apache2 stop
install MySQL
$ sudo apt-get update
$ sudo apt-get install mysql-server
$ mysql_secure_installation
設(shè)置Ubuntu允許遠(yuǎn)程連接MySQL
需要修改 Mysql 配置文件
sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf
將 bind-address = 127.0.0.1 這一行注釋掉, 即修改為:
#bind-address = 127.0.0.1
修改 root 密碼
步驟一:登錄mysql
sudo mysql -u root -p
步驟二:查看user表:
select user, plugin from mysql.user;
發(fā)現(xiàn)root的plugin并不是本地密碼撞叨,因此需要修改它等舔,但由于MySQL5.6.6版本之后增加了密碼強(qiáng)度驗(yàn)證插件validate_password,相關(guān)參數(shù)設(shè)置的較為嚴(yán)格震放。
如果要設(shè)置為簡單密碼,則需修改密碼規(guī)則的配置权谁,參考博客:https://blog.csdn.net/kuluzs/article/details/51924374
步驟三:修改mysql參數(shù)配置:
set global validate_password_policy=0;
set global validate_password_mixed_case_count=0;
set global validate_password_number_count=3;
set global validate_password_special_char_count=0;
set global validate_password_length=3;
步驟四:修改root密碼
update mysql.user set authentication_string=PASSWORD('123'), plugin='mysql_native_password' where user='root';
步驟五:刷新
flush privileges;
到此 Mysql-Server 端配置就完成了.
install phpMyadmin
$ sudo apt install phpmyadmin
軟件安裝在了/usr/share/下,所以你的phpmyadmin在/usr/share下可以找到.
建立一個(gè)軟連接限佩,使得第三步中顯示的文件和/var/www/html下的某個(gè)文檔鏈接起來叛溢,回到/var/www/html蹈集,輸入一下代碼
$ sudo ln -s /usr/share/phpmyadmin phpmyadmin
解決辦法:
# php.ini 路徑 : :/etc/php/7.0/apache2/php.ini
sudo apt-get install php7.0-mbstring
phpMyadmin 隱藏 數(shù)據(jù)庫
找到了phpmyadmin/config.inc.php文件,位置在
/etc/phpmyadmin
修改
$cfg['Servers'][$i]['hide_db'] = ''; // Database name to be hidden from listings
我們只要把information_schema填寫在引號里面就好了雇初。
填玩以后重新登錄到PHPMyAdmin,會發(fā)現(xiàn)這個(gè)數(shù)據(jù)庫已經(jīng)不會顯示了减响。
如果要隱藏多個(gè)可以用"|"來隔開其他數(shù)據(jù)庫名靖诗,例如:
$cfg['Servers'][$i]['hide_db'] = '(information_schema|phpmyadmin|mysql| performance_schema | sys)';
只是為了安全的目的隱藏起來。
如果想要隱藏全部以a開頭的數(shù)據(jù)庫支示,可以使用'^a'刊橘。
apache2 配置 phpmyadmin
進(jìn)入到 目錄 /etc/apache2/sites-available
從默認(rèn)配置復(fù)制一份
sudo cp 000-default.conf phpmyadmin.conf
修改內(nèi)容,修改 DocumentRoot
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/phpmyadmin
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
重啟 apache2
sudo systemctl restart apache2.service
ubuntu設(shè)置ssh登陸
install openssh-server
$ sudo apt-get install openssh-server
啟動服務(wù)颂鸿。
$ sudo service ssh start
或者是:
$ sudo /etc/init.d/ssh restart
關(guān)閉了ssh server的服務(wù)促绵,不再允許別人通過ssh遠(yuǎn)程登陸你的操作系統(tǒng)
$ sudo service ssh stop
安裝ftp服務(wù)器
sudo apt-get update
sudo apt-get install vsftpd
執(zhí)行完該步驟,vsftpd服務(wù)已經(jīng)安裝
- 修改ftp的配置文件 /etc/vsftpd.conf
(a)向文件中添加如下內(nèi)容:
userlist_deny=NO
userlist_enable=YES
#允許登錄的用戶
userlist_file=/etc/allowed_users
seccomp_sandbox=NO
local_enable=YES
#設(shè)置文件上傳
write_enable=YES
#使用utf8
utf8_filesystem=YES
使文件中的"local_enable=YES"保存嘴纺。
(b)新建/etc/allowed_users文件
sudo vim /etc/allowed_users
假設(shè)我只想讓xuanxufeng和root訪問ftp服務(wù)器败晴,那么輸入xuanxufeng,root-->保存OK!以后還有其它用戶使用ftp時(shí)直接添加用戶名就可以了栽渴!
(c)使用vim查看/etc/ftpusers文件中的內(nèi)容
sudo vim /etc/ftpusers
打開這個(gè)文件后尖坤,看一看有沒有uftp這個(gè)用戶名,如果沒有闲擦,就直接退出慢味。如果有就刪除uftp,因?yàn)檫@個(gè)文件中記錄的是不能訪問FTP服務(wù)器的用戶清單。
重啟vsftp服務(wù)器墅冷。
- 啟動, 停止, 重啟服務(wù)
sudo /etc/init.d/vsftpd start
sudo /etc/init.d/vsftpd stop
sudo /etc/init.d/vsftpd restart
- 訪問ftp服務(wù)器
sudo ftp 127.0.0.1
瀏覽器訪問
ftp://127.0.0.1
或者
ftp://localhost
遠(yuǎn)程訪問時(shí)使用實(shí)際ip:
ftp://your_ip
ubuntu16.04 無法安裝 google chrome
下載
$ wget -c https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
安裝
$ sudo dpkg -i google-chrome-stable_current_amd64.deb
安裝遇到
把電腦重灌ubuntu 16.04 纯路,去google官網(wǎng)下載chrome穩(wěn)定版後,點(diǎn)擊檔案後寞忿,按安裝卻一直卡住沒有反應(yīng)
這個(gè)情況驰唬,是某個(gè)相依的套件沒有事先安裝,所以導(dǎo)致發(fā)生例外了罐脊,
只要執(zhí)行下面的指令定嗓,就可以幫你把相依的套件補(bǔ)齊了
$ sudo apt-get install -f
若上面還不能解決,就執(zhí)行下面的指令萍桌,讓安裝系統(tǒng)恢復(fù)可運(yùn)作的狀態(tài)
$ sudo apt-get remove chrome-chrome-stable