我正在尝试在 Ubuntu 服务器 10.04(64 位)上启动 postgresql 8.4。
首先,我尝试将:su -c 'pg_ctl start -D /home/postgres -l /home/postgres/serverlog' --preserve-environment postgres
放在 的末尾init.d/rc.local
,但无济于事。服务器日志文件甚至不在系统上。
然后我尝试运行update-rc.d postgresql-8.4 defaults
,它喷出:
System start/stop links for /etc/init.d/postgresql-8.4 already exist.
一条相关信息是,通过在su -c 'pg_ctl start -D /home/postgres -l /home/postgres/serverlog' --preserve-environment postgres
没有 --preserve-environment 标志的情况下以 root 身份运行,它无法识别 pg_ctl。否则,服务启动,我可以连接到数据库。但即使保留了环境,服务在 init 文件中运行时也不会启动。
有什么线索吗?谢谢!维克。
我正在用 tomcat 开发一个 web 应用程序。在 dev env 中,应用程序的根地址是localhost:8080/myapp/
. 在生产中,根地址是www.myapp.com/
.
当我在我的网站中使用相对链接时,例如/home
,它在生产中工作正常,但我在我的开发中到达的地址是localhost:8080/home
,它会剥离应用程序的根。显然,我不能只使用home
,因为它会在第一次工作,但只会连接到地址字符串的末尾。我也不能使用主机文件,我不知道如何创建别名或只是将流量从某个别名重定向到localhost:8080/myapp/
.
这似乎是一个非常普遍的问题。提前致谢!