http - 如何启动 nostromo 网络服务器?
问题描述
我正在尝试启动 nostromo 网络服务器(http://nazgul.ch/dev_nostromo.html)。编译后,我对配置进行了一些更改。但是当我试图启动“nhttpd”时 - 没有任何反应。哪位大神知道怎么用,没找到攻略。这是我的配置:
# MAIN [MANDATORY]
servername localhost:80
serverlisten 127.0.0.1
serveradmin root@localhost
serverroot /var/nostromo
servermimes conf/mimes
docroot /var/nostromo/htdocs
docindex index.html
# LOGS [OPTIONAL]
logpid logs/nhttpd.pid
logaccess logs/access_log
# SETUID [RECOMMENDED]
user root
# BASIC AUTHENTICATION [OPTIONAL]
#htaccess .htaccess
#htpasswd /var/nostromo/conf/.htpasswd
#htpasswd +bsdauth
#htpasswd +bsdauthnossl
# SSL [OPTIONAL]
#sslport 443
#sslcert /etc/ssl/server.crt
#sslcertkey /etc/ssl/private/server.key
# CUSTOM RESPONSES [OPTIONAL]
#
# The custom responses are searched in the corresponding document root.
# ALIASES [OPTIONAL]
/icons /var/nostromo/icons
# VIRTUAL HOSTS [OPTIONAL]
# HOMEDIRS [OPTIONAL]
解决方案
# MAIN [MANDATORY]
servername 127.0.0.1:8080
serverlisten *
serveradmin webmaster@nazgul.ch
serverroot /var/nostromo
servermimes conf/mimes
docroot /var/nostromo/htdocs
docindex index.html
# LOGS [OPTIONAL]
logpid logs/nhttpd.pid
logaccess logs/access_log
# SETUID [RECOMMENDED]
user daemon
# ALIASES [OPTIONAL]
/icons /var/nostromo/icons
I have my config file like this. The user option cannot be root. My system is CentOS, so the web daemon user is called daemon. On Debian, it would be www-data.
In addition, you may need to chmod the /var/nostromo/logs directory with all permissions (777).
Then, depending on your system, you start the server as a non-root user with sudo privileges like so:
$ sudo nhttpd
or
$ sudo /usr/local/sbin/nhttpd
If you try to enable IPv6 with the -4 flag, it will complain.
I tried various combinations of these steps and doing all of them was the only way it worked for me. I don't know why this is the case, but it is what it is.
For reference, this is written for nhttpd v1.9.6.
推荐阅读
- php - 如何从命令终端获取网络流量并在 PHP 中显示
- react-native - Redux Persist,rehydrate 不能在 android 上工作
- entity-framework - 批量插入记录时,临时表在操作结束后不会删除,并且在第三个临时表处插入失败
- c++ - 如何在 cpp 中使用协议缓冲区存储大缓冲区/数组(char/int)...?
- reactjs - Express Js 如何作为项目的 devDependencies 工作
- javascript - 如何在单击按钮时删除多行
- openssl - 使用 api 的带有密码短语参数的 openssl 证书请求
- php - 使用 curl 在 null 响应时循环遍历数据
- python - 错误:413 请求太大 - 带有可恢复 MediaIoBaseUpload 请求的 Python Google Drive API
- r - 使用mailR包从R发送邮件得到错误