|
The new password for the “root” of
MySQL
|
Sunday, August 26, 2018
Build a webserver with CentOS 7, MySQL, PHP7.2 and use a existing wildcard SSL Certificate from Windows Server
Monday, September 16, 2013
IPTABLES Rule
# iptables -F
# iptables -A INPUT -i lo -j ACCEPT
# iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# iptables -A INPUT -p tcp --dport 22 -j ACCEPT
# iptables -A INPUT -p udp --dport 53 -j ACCEPT
# iptables -P INPUT DROP
# iptables -P FORWARD DROP
# iptables -P OUTPUT ACCEPT
# iptables -L -v
# /sbin/service iptables save
Thursday, August 15, 2013
Howto disable or enable SElinux on Centos 6.4 Redhat RHEL 6.4
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing – SELinux security policy is enforced.
# permissive – SELinux prints warnings instead of enforcing.
# disabled – No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted – Targeted processes are protected,
# mls – Multi Level Security protection.
SELINUXTYPE=targeted
Monday, June 17, 2013
How to use Yum command to install「setup」(Text Mode Setup Utility) for CentOS 6.2 manually
Friday, October 12, 2012
Install PHP 5.3 on CentOS 5
rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm
yum --enablerepo=webtatic install php
yum --enablerepo=webtatic update php
Wednesday, February 9, 2011
Slove Error Message in Lunix on Virtual machine
Time: pit
clocksource has been installed
Add "clock: pit" to /boot/grub/menu.lst
Tuesday, January 4, 2011
Solve Bind 9 dumping master file: tmp-XXXX: open: permission denied problem
ENABLE_ZONE_WRITE=yes
Friday, December 31, 2010
Add SSL to CentOS
1. #install ssl realted program
yum install mod_ssl openssl
2. # generate private key
openssl genrsa -out ca.key 1024 3. # generae CSR from private key openssl req -new -key ca.key -out ca.csr 4. # generate self assign certificate openssl x509 -req -days 365 -in ca.csr -signkey ca.key -out ca.crt 5. # Copy file to appropiate location cp ca.crt /etc/pki/tls/certs cp ca.key /etc/pki/tls/private/ca.key cp ca.csr /etc/pki/tls/private/ca.csr
6. #Edit Apache SSL configuration file
vi +/SSLCertificateFile /etc/httpd/conf.d/ssl.conf7.#Edit following linesSSLCertificateFile /etc/pki/tls/certs/ca.crtSSLCertificateKeyFile /etc/pki/tls/private/ca.key8. #Restart Apache serverservice httpd restart9. #create directory for SSL virtual hostcd /var/wwwmkdir htmlcd /varmkdir www-sslcd www-sslmkdir html10. # To configure HTTPS over port 443vi /etc/httpd/conf.d/ssl.conf11. # Example HTTPS configurationSSLEngine on SSLCertificateFile /etc/pki/tls/certs/ca.crt SSLCertificateKeyFile /etc/pki/tls/private/ca.key 12. #Restart Apache serverAllowOverride All DocumentRoot /var/www-ssl/html ServerName FQDN of web serverservice httpd restart13. #Put html file to /var/www-ssl/html
Sunday, December 19, 2010
Add additional yum source in CentOS
root@linuxbox ~]# wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/ius-release-1.0-6.ius.el5.noarch.rpm root@linuxbox ~]# wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/epel-release-1-1.ius.el5.noarch.rpm root@linuxbox ~]# rpm -Uvh ius-release*.rpm epel-release*.rpm
yum install yum-plugin-replace
yum replace php --replace-with php53
Monday, March 23, 2009
CentOS用yum安裝php+mysql+apache
1. 安裝Apahce, PHP, Mysql, 以及php連接mysql庫組件。
yum -y install httpd php mysql mysql-server php-mysql php-mcrypt
2. 配置開機啓動服務
/sbin/chkconfig httpd on [設置apache服務器httpd服務開機啓動] /sbin/chkconfig –add mysqld [在服務清單中添加mysql服務] /sbin/chkconfig mysqld on [設置mysql服務開機啓動]
/sbin/service httpd start [啓動httpd服務,與開機啓動無關] /sbin/service mysqld start [啓動mysql服務,與開機無關]
3.設置mysql數據庫root帳號密碼。
mysqladmin -u root password ‘newpassword’ [引號內填密碼]
4. 讓mysql數據庫更安全
mysql -u root -p
mysql> DROP DATABASE test; [刪除test數據庫]mysql> DELETE FROM mysql.user WHERE user = ”; [刪除匿名帳戶]mysql> FLUSH PRIVILEGES; [重載權限]
5. 按照以上的安裝方式, 配置齣來的默認站點目錄為/var/www/html/新建一個php腳本:
6. 新建一個數據庫﹐添加一個數據庫用戶﹐設置用戶權限。寫個php腳本測試一下數據庫連接吧。
mysql> CREATE DATABASE my_db;mysql> GRANT ALL PRIVILEGES ON my_db.* TO ‘user’@'localhost’ IDENTIFIED BY ‘password’; //安裝apache擴展yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql//安裝php的擴展yum install php-gdyum -y install php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc//安裝mysql擴展yum -y install mysql-connector-odbc mysql-devel libdbi-dbd-mysql
Wednesday, March 4, 2009
MYSQL跟phpMyAdmin 的安裝
一開始想說使用偉大的yum來安裝,但是卻不是那麼順利
1.yum可以安裝mysql沒問題2.CentOS5.2的yum沒有phpMyAdmin,如果Fedora就可以用yum安裝phpMyAdmin
好現在從頭一步一步來講解怎麼做安裝 MySQL+phpMyAdmin1.#yum install mysql-server mysql php-mysql php-mbstring libmcrypt php-mcrypt
2.到phpMyAdmin網頁下載最新的套件http://www.phpmyadmin.net/home_page/index.php將下載回來的tar檔解開#tar zxvf phpMyAdmin-2.11.8.1-all-languages.tar.gz再將解壓縮的資料夾改名並移動到網頁的根目錄(預設為/var/www/html)#mv ./phpMyAdmin-2.11.8.1-all-languages /var/www/html/phpMyAdmin
設定再來就是將剛剛安裝好的與phpMyAdmin做個簡單的設定mysql安裝完最重要的就是將mysql內的管理者帳號root設定密碼等會登入phpMyAdmin時就需要這帳號與密碼.
MYSQL先將mysql的服務啟動#chkconfig mysqld on#service mysqld start
以下範例為將預設的空密碼改為"my1234"#mysqladmin -u root password my1234如果你是要將舊密碼改為"my1234"#mysqladmin -u root -p password my1234Enter password: <==這裡請輸入舊的密碼 phpMyAdmin先到phpmyadmin的目錄裡面#cd /var/www/html/phpMyAdmin產生config.inc.php設定檔預設是沒有這個檔案的,要先將config.sample.inc.php複製成config.inc.php#cp ./config.sample.inc.php ./config.inc.php將認證方式改為http或是cookie還有修改hostname 如果你要以http認證只要修改2個地方#vi ./config.inc.php$cfg['Servers'][$i]['auth_type'] = 'http'; <==改為http$cfg['Servers'][$i]['host'] = 'example.com.tw'; <==改成你的電腦名稱 如果你要以cookie認證方式那你還要多設一個地方#vi ./config.inc.php$cfg['blowfish_secret'] = 'gtry356dfgejdkv42jnl5'; <==隨便輸入亂數的字讓cookie做密碼加密演算,最多46個字$cfg['Servers'][$i]['auth_type'] = 'cookie'; <==改為cookie$cfg['Servers'][$i]['host'] = 'example.com.tw'; <==改成你的電腦名稱 做完以上2個設定就完成了因為之前有安裝一些php的套件,所以要重起httpd#service httpd restart到瀏覽器輸入以下網址http://localhost/phpMyAdmin/使用mysql的root與密碼就可以登入phpMyAdmin管理MYSQL了
Prevent or Prohibit Server Drives From Being Visible to Users
To make changes to this policy for one of the seven default values: Start the Microsoft Management Console. On the Console menu, click Ad...
-
Connect to the ESXi host with SSH Stop the USB arbitrator service. This service is used to passthrough USB device from an ESX/ESXi host to...
-
To make changes to this policy for one of the seven default values: Start the Microsoft Management Console. On the Console menu, click Ad...
-
Hyper-V R2 brings some powerful virtualization to the table for those of us who do not have either the skills or the desire to work with vir...




















