Update all packages
# yum -y update
# yum -y update
# wget http://downloads.sourceforge.net/project/webadmin/webmin/1.520/webmin-1.520.tar.gz # tar -zxvf webmin-1.520.tar.gz # cd webmin-1.520 webmin-1.520]# ./setup.sh *********************************************************************** * Welcome to the Webmin setup script, version 1.520 * *********************************************************************** Webmin is a web-based interface that allows Unix-like operating systems and common Unix services to be easily administered. Installing Webmin in /root/webmin-1.520 ... *********************************************************************** Webmin uses separate directories for configuration files and log files. Unless you want to run multiple versions of Webmin at the same time you can just accept the defaults. Config file directory [/etc/webmin]: Log file directory [/var/webmin]: *********************************************************************** Webmin is written entirely in Perl. Please enter the full path to the Perl 5 interpreter on your system. Full path to perl (default /usr/bin/perl): Testing Perl ... Perl seems to be installed ok *********************************************************************** Operating system name: CentOS Linux Operating system version: 5.5 *********************************************************************** Webmin uses its own password protected web server to provide access to the administration programs. The setup script needs to know : - What port to run the web server on. There must not be another web server already using this port. - The login name required to access the web server. - The password required to access the web server. - If the webserver should use SSL (if your system supports it). - Whether to start webmin at boot time. Web server port (default 10000): Login name (default admin): Login password: Password again: The Perl SSLeay library is not installed. SSL not available. Start Webmin at boot time (y/n): Y *********************************************************************** Creating web server config files.. ..done Creating access control file.. ..done Inserting path to perl into scripts.. ..done Creating start and stop scripts.. ..done Copying config files.. ..done Creating uninstall script /etc/webmin/uninstall.sh .. ..done Changing ownership and permissions .. ..done Running postinstall scripts .. ..done Enabling background status collection .. ..done Attempting to start Webmin mini web server.. Starting Webmin server in /root/webmin-1.520 Pre-loaded WebminCore ..done *********************************************************************** Webmin has been installed and started successfully. Use your web browser to go to http://yourserver.com:10000/ and login with the name and password you entered previously.
[Webmin] -> [Webmin configuration] -> [SSL Encryption] set Enable SSL if available? Yes Redirect non-SSL requests to SSL mode? Yes
# yum -y install httpd mod_ssl GeoIP*
[mysqld] datadir = /var/lib/mysql socket = /var/lib/mysql/mysql.sock user=mysql old_passwords=1 set-variable = table_cache=512 set-variable = key_buffer=256M set-variable = sort_buffer=8M set-variable = myisam_sort_buffer_size=256M set-variable = max_allowed_packet=1M set-variable = net_buffer_length=4M set-variable = max_heap_table_size=256M set-variable = join_buffer_size=8M set-variable = read_buffer_size=16M set-variable = read_rnd_buffer_size=8M set-variable = sort_buffer_size=4M set-variable = bulk_insert_buffer_size=8M set-variable = query_cache_type=1 set-variable = query_cache_size=256M big-tables skip-locking innodb_file_per_table = 1 [mysqld_safe] log-error=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid
yum -y install php php-*
UTC=true ARC=false ZONE=Asia/Taipei
Action Condition Accept If input interface is not eth0 Accept If protocol is TCP and TCP flags ACK (of ACK) are set Accept If state of connection is ESTABLISHED Accept If state of connection is RELATED Accept If protocol is UDP and destination port is 1024:65535 and source port is 53 Accept If protocol is ICMP and ICMP type is echo-reply Accept If protocol is ICMP and ICMP type is destination-unreachable Accept If protocol is ICMP and ICMP type is source-quench Accept If protocol is ICMP and ICMP type is time-exceeded Accept If protocol is ICMP and ICMP type is parameter-problem Accept If protocol is ICMP and ICMP type is echo-request Accept If protocol is TCP and destination port is 22 Accept If protocol is TCP and destination port is 80 Accept If protocol is TCP and destination port is 10000
<Location /phpMyAdmin> Order deny,allow allow from all </Location>
[c5-testing] name=CentOS-5 Testing baseurl=http://dev.centos.org/centos/5/testing/$basearch/ enabled=1 gpgcheck=1 gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing
<IfModule mod_deflate.c> # compress content with type html, text, and css AddOutputFilterByType DEFLATE text/html text/plain text/css AddOutputFilter DEFLATE js css html ico <IfModule mod_headers.c> # properly handle requests coming from behind proxies Header append Vary User-Agent </IfModule> </IfModule> <IfModule mod_expires.c> ExpiresActive on ExpiresByType image/jpg "access plus 7 days" ExpiresByType image/jpeg "access plus 7 days" ExpiresByType image/gif "access plus 7 days" ExpiresByType image/png "access plus 7 days" ExpiresByType application/x-javascript "access plus 7 days" ExpiresByType application/x-shockwave-flash "access plus 1 month" ExpiresByType text/html "access plus 1 day" ExpiresByType text/css "access plus 7 days" ExpiresDefault "access 2 days" </IfModule> AllowOverride All <VirtualHost *:80> ServerAdmin root@example.com DocumentRoot /var/www/example ServerName www.example.com ErrorLog logs/www.example.com-error.log CustomLog logs/www.example.com-access.log common </VirtualHost>
; 請自行查出相對應的位置加上或修改參數 [global] display charset = UTF8 dos charset = UTF8 unix charset = UTF8 guest account = apache security = share [www] comment = Web Directory path = /var/www public = yes writable = yes browseable = yes printable = no guest ok = yes write list = +staff create mode = 0777 directory mode = 0777 create mask = 0777 force create mode = 0777 security mask = 0777 force security mode = 0777 directory mask = 0777 force directory mode = 0777 directory security mask = 0777 force directory security mode = 0777 acl check permissions = False