2025年4月3日 | 版本 8.0
东方通HTTP Server是一款国产高性能Web服务器软件,广泛应用于政府、金融、电信等行业。本指南将详细介绍如何安装和配置东方通HTTP Server。
支持高并发连接,优化处理静态和动态内容
提供多种安全机制,符合国产化安全要求
支持负载均衡和故障转移,确保服务连续性
注意: 生产环境建议使用专用服务器,配置应根据实际业务需求调整。
scp tonghttpd-8.0-linux-x64.tar.gz root@your-server:/opt
cd /opt tar -zxvf tonghttpd-8.0-linux-x64.tar.gz
cd tonghttpd-8.0
./install.sh
安装过程中会提示选择安装路径、端口号等配置,可按默认值或根据需求修改。
service tonghttpd start
打开浏览器访问 http://localhost:8080 (默认端口8080),应该能看到东方通HTTP Server的欢迎页面。
检查服务状态(Linux):
service tonghttpd status
检查服务状态(Windows):
sc query TongHttpd
/opt/tonghttpd/conf/httpd.conf
C:\TongHttpd\conf\httpd.conf
Listen 8080 ServerName localhost:8080
修改后需要重启服务生效:
service tonghttpd restart
DocumentRoot "/opt/tonghttpd/htdocs"
<Directory "/opt/tonghttpd/htdocs"> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory>
ErrorLog "/opt/tonghttpd/logs/error_log" CustomLog "/opt/tonghttpd/logs/access_log" common
# 最大客户端连接数 MaxClients 500 # 每个子进程处理的请求数 MaxRequestsPerChild 10000 # 连接超时时间(秒) Timeout 300 # 保持连接 KeepAlive On KeepAliveTimeout 15
<VirtualHost *:8080> ServerName www.example.com DocumentRoot "/opt/tonghttpd/htdocs/example" ErrorLog "/opt/tonghttpd/logs/example_error_log" CustomLog "/opt/tonghttpd/logs/example_access_log" common </VirtualHost>
LoadModule ssl_module modules/mod_ssl.so Listen 443 <VirtualHost *:443> SSLEngine on SSLCertificateFile "/opt/tonghttpd/conf/ssl/server.crt" SSLCertificateKeyFile "/opt/tonghttpd/conf/ssl/server.key" SSLCertificateChainFile "/opt/tonghttpd/conf/ssl/ca.crt" </VirtualHost>
<Proxy balancer://mycluster> BalancerMember http://192.168.1.101:8080 BalancerMember http://192.168.1.102:8080 </Proxy> ProxyPass / balancer://mycluster/ ProxyPassReverse / balancer://mycluster/
LoadModule rewrite_module modules/mod_rewrite.so <Directory "/opt/tonghttpd/htdocs"> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php?path=$1 [L,QSA] </Directory>
netstat -tulnp | grep 8080 # Linux netstat -ano | findstr 8080 # Windows
tail -n 50 /opt/tonghttpd/logs/error_log
/opt/tonghttpd/bin/httpd -t
firewall-cmd --list-ports # CentOS ufw status # Ubuntu
getenforce setenforce 0 # 临时关闭
ls -ld /opt/tonghttpd/htdocs
netstat -an | grep 8080 | wc -l
service tonghttpd start # Linux net start TongHttpd # Windows
service tonghttpd stop # Linux net stop TongHttpd # Windows
service tonghttpd restart # Linux net stop TongHttpd && net start TongHttpd # Windows
Linux系统可配置logrotate:
/opt/tonghttpd/logs/*.log { daily missingok rotate 30 compress delaycompress notifempty sharedscripts postrotate /usr/bin/killall -HUP httpd endscript }
tar -czvf tonghttpd-conf-backup-$(date +%Y%m%d).tar.gz /opt/tonghttpd/conf