Linux route configuration-Linux Enterprise Application-Linux server application information. For details, refer to the following section. RedHat Linux 9: Configure routes [classic + favorites]. I hope you can take a shortcut...
RedHat Linux 9 configures routing, transparent proxy, firewall, SAMBA, apache + php + mysql, CS 1.5 server, and hard disk performance optimization!
A *** previously used WIN2003 to provide NAT shared Internet access for *** and installed the rising firewall. The IIS6 provided by the system supports ASP. NET.
* ***** Optical fiber access, fixed IP address. the server is configured with P4 2.4, 512 m ddr, 845G motherboard, IDE 120G hard drive, D-Link 530Tx dual Nic, and LINUX9 with built-in driver. Therefore, you can use it directly after installation ~ :} Eth0 connected to the Internet, IP: 192.168.1.10 mask: 255.255.255.0 Gateway: 192.168.1.1 eth1 connected to the Intranet, IP: 192.168.2.1 mask: 255.255.255.0; DNS: 202.102.128.68; 202.102.152.3; principal (DNS) machine name netserver. linux ssh service is used for configuration. The IP address of the machine is 192.168.2.3. For win2k's system, the two files are named psftp.exeand putty.exe. the Server only provides WEB Services and CS services. Therefore, the open ports are only WWW ports and CS ports 27017, 27015 <1.5 is 27016 PUB server, and 1.6 is Race Server, 27017 is 1.5 Race Server (because of the time relationship, the F of 1.6 has not been done yet: {)>
In linux, the default language is ENGLISH. When selecting a file package, select none of the packages, and then select only the WEB server, PHP, MYSQL options, and SAMBA and SSH. in this way, the total space required is about MB ~ During the installation process, configure the IP address, mask, gateway, and DNS. After the installation, you can use SSH!
First, configure Internet sharing and firewall! <以下内容为转帖,并经过简单修改>
In this example, iptables rejects all packets and opens the packets to be released, which is highly secure.
Vi/bin/firewall. iptables # create a new document in the/bin directory named firewall. iptables
The content is as follows:
#! /Bin/bash
# Load module Load related modules
Modprobe ip_tables
Modprobe ip_nat_ftp
Modprobe ip_conntrack
Modprobe ip_conntrack_ftp
Modprobe ip_conntrack_irc
# Start firewall service with deny all IPTABLES initial setting: reject all packets.
Iptables-F
Iptables-F-t nat
Iptables-X
Iptables-X-t nat
Iptables-P INPUT DROP
Iptables-P FORWARD ACCEPT
Iptables-P OUTPUT DROP
# Set eth1 as a trusted Device
Iptables-a input-I eth1-j ACCEPT
Iptables-a output-o eth1-j ACCEPT
# ICMP Control the external computer cannot PING this host, but this host can PING the external computer
Iptables-a output-o eth0-p icmp-j ACCEPT
Iptables-a input-I eth0-p icmp -- icmp-type echo-reply-j ACCEPT
Iptables-a input-I eth0-p icmp -- icmp-type echo-request-j DROP
# Outgoing allow WAN packets sent from this host
Iptables-a input-I eth0-p TCP -- sport www-j ACCEPT
Iptables-a output-o eth0-p TCP -- dport www-j ACCEPT
Iptables-a input-I eth0-p UDP -- sport www-j ACCEPT
Iptables-a output-o eth0-p UDP -- dport www-j ACCEPT
Iptables-a input-I eth0-p TCP -- sport 27015-j ACCEPT
Iptables-a output-o eth0-p TCP -- dport 27015-j ACCEPT
Iptables-a input-I eth0-p TCP -- sport 27016-j ACCEPT
Iptables-a output-o eth0-p TCP -- dport 27016-j ACCEPT
Iptables-a input-I eth0-p TCP -- sport 27017-j ACCEPT
Iptables-a output-o eth0-p TCP -- dport 27017-j ACCEPT
# Set nat camouflage IP with more to one NAT packet disguise
Echo "1">/proc/sys/net/ipv4/ip_forward
# Iptables-t nat-a prerouting-I eth1-p tcp-s 192.168.2.0/24 -- dport 80-j DNAT -- to 192.168.2.1: 3128
# Iptables-t nat-a prerouting-I eth1-p tcp-s 192.168.2.0/24 -- dport 80-j REDIRECT -- to-port 3128
Iptables-t nat-a postrouting-s 192.168.2.0/24-o eth0-j MASQUERADE
At this point, the firewall. iptables content has ended.
Set firewall. iptables to an executable file
Chmod 700/bin/firewall. iptables
Run firewall. iptables automatically upon startup
Vi/etc/rc. d/rc. local
Add firewall. iptables at the end
Other: port number, please refer to/etc/services? Hot? Br/> cat/etc/services | less # view/etc/services? Hot Swap ?? Age down to next page
# Press Leave
# Run firewall. iptabls
Firewall. iptables
# Generate a firewall rule file under/etc/sysconfig/
Cd/etc/sysconfig
Iptables-save> iptables
Now, the firewall configuration is complete!
Squid proxy settings
The following is my/etc/squid. conf content
Note: Because SAMBA is only used by myself, it shares the root directory and has full permissions! I usually turn off the SAMBA service and only enable it when it is used.
WEB Settings
Because PHP, MYSQL, and related items are selected during installation, this configuration is especially easy:}. The following is my/etc/httpd/conf/httpd. changed in conf, but not elsewhere
You need to change the Mysql root Password! I modified phpadmin and deleted all users except root/localhost!
System Service:
Use the ntsysv command to open service settings. The services I open include httpd, iptables, mysqld, network, smb, squid, sshd, and syslog.
You can also use the servies service name stop/start to stop or open the service.
Example: servies httpd stop
Hard Disk Optimization. data must be backed up before optimization. No one can save you! :{
Display hard drive parameters:
Hdparm-v/dev/hda
Test hard drive performance:
Hdparm-Tt/dev/hda
In/etc/rc. d/rc. add the following command in local to automatically optimize the system during startup. you must test it before adding it, and see how to change it to high performance.
Hdparm-c3-d1-k1-m16-a64/dev/hda
CS 1.5 server setup!
The required files hlds_l_3111_full.bin,cs_15_full.tar.gz (read other articles on the Internet and add the cd key-free patch. It's useless if I don't find it, but it can be used in the same way without the CDKEY-free patch ~)
Use the chmod 700 hlds_l_3111_full.bin compressed file! After decompression, A hlds_ldirectory is obtained. Then, extract cs_15_full.tar.gz to the hlds_l directory!
My hlds_l directory/game/hlds_l
Vi/bin/startcs1
Cd/game/hlds_l
./Hlds_run-game cstrike + ip 192.168.1.10 + port 27015 + maxplayers 22 + map de_dust2-nomaster + sv_lan 1 + server1_file server1.cfg + mapcyclefiles mapcycle1.txt + motdfile motd1.txt
Chmod 700/bin/startcs1
In this way, you can directly enter startcs1 when you want to open the CS server!
If the CS server crashes halfway, you need to manually enter startcs1, which is very troublesome! Use the following method to solve the problem!
Vi/bin/autostartcs1
While true
Do
Startcs1
Done
Vi/bin/autostartcs2
While true
Do
Startcs2
Done
Vi/bin/autostartcs3
While true
Do
Startcs3
Done
When opening the CS server, use autostartcs1! In this way, the CS server is not afraid to be crashed in the middle!
FOR the installation of the CS server plug-in, download the FOR linux version from www.unitedadmins.com and decompress it to hlds_l/cstrike, FOR example, hlds/cstrike/addons/amx.
Remember to add the following to each server. cfg:
Max_queries_sec "5"
Max_queries_sec_global "10"
Max_queries_window "30"
Otherwise, the CS server may be disconnected from each other!
Appendix/hlds_l/cstrike/liblist. gam content
Game "Counter-Strike"
Url_info "www.counter-strike.net"
Url_dl ""
Version 1.5"
Size: 184000000"
Svonly "0"
Secure "0"
Type "multiplayer_only"
Cldll "1"
Hlversion "1110"
Nomodels "1"
Nohimodel "1"
Mpentity "info_player_start"
Gamedll_linux "addons/metamod/dlls/metamod_i386.so"
Trainmap "tr_1"
/Hlds_l/cstrike/addons/metamod/plugins. ini file content
Linux addons/wwcl/dlls/pcawwclconfig_mm_i386.so
Linux addons/booster/booster_mm.so
Linux addons/amx/dlls/amx_mm_i386.so
Linux addons/amx/dlls/fun_ms_i386.so
// Linux addons/amx/dlls/war3_ms_i386.so
// Linux addons/amx/dlls/udp_ms_i386.so
Linux addons/amx/dlls/csstats_ms_i386.so
// Linux addons/hlguard/dlls/hlguard_mm_i586.so
// Linux addons/cdeath/cdmod_i586.so
// Linux addons/chickenmod/dlls/chicken_mm_i386.so
// Linux addons/statsme/dlls/sm_cstrike_mm_i386.so
// Linux addons/clanmod/dlls/clanmod_mm_i586.so
NOTE: If PING occurs, you can change the priority of the program HLDS!
Display process:
Ps-e
.............
3386 pts/0 00:00:00 hlds_run
........
Increase the priority of a process ID to 3386 HLDS
Renice + 1 3386
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service