Hello,

I tried to install Ghost, install went fine (installation of node.js + ghost), but the problem is, after it's installed, apache2 won't start anymore.

Also Server status in the script info is down, when I click on start it say ok, but still down. Is there a conflict between node.js and apache2?

Status: 
Active

Comments

Howdy -- do you happen to have the error that you receive when trying to start Apache, after installing the Ghost blog?

There's a few different possibilities of what's occurring; while it's possible that something is interfering with port 80 or 443, it's also possible that the issue is related to a syntax error or missing Apache module.

Ok, so this is what happens exactly when I install the script:
In the error log for the domain:

[Wed Aug 06 12:23:21.645427 2014] [proxy_balancer:emerg] [pid 7879] (22)Invalid argument: AH01183: Cannot share balancer

In the apache error log:

[Wed Aug 06 12:23:21.493685 2014] [mpm_prefork:notice] [pid 7879] AH00171: Graceful restart requested, doing restart
[Wed Aug 06 12:23:21.615589 2014] [auth_digest:notice] [pid 7879] AH01757: generating secret for digest authentication ...
[ 2014-08-06 12:23:21.6196 8971/7fc2b8fa7780 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/bin/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini', 'passenger_version' => '4.0.37', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.37', 'web_server_pid' => '7879', 'web_server_type' => 'apache', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
[ 2014-08-06 12:23:21.6226 8974/7ff5a6086780 agents/HelperAgent/Main.cpp:643 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.7879/generation-1/request
[ 2014-08-06 12:23:21.6284 8980/7f2032e6a780 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.7879/generation-1/logging
[ 2014-08-06 12:23:21.6285 8971/7fc2b8fa7780 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[Wed Aug 06 12:23:21.645409 2014] [proxy:crit] [pid 7879] AH02432: Cannot find LB Method: byrequests
[Wed Aug 06 12:23:21.645442 2014] [:emerg] [pid 7879] AH00020: Configuration Failed, exiting

And if I try to start apache2:

[ 2014-08-06 12:24:56.7777 9309/7f411e11c780 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/bin/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini', 'passenger_version' => '4.0.37', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.37', 'web_server_pid' => '9308', 'web_server_type' => 'apache', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
[ 2014-08-06 12:24:56.7806 9312/7fa4e54b7780 agents/HelperAgent/Main.cpp:643 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.9308/generation-0/request
[ 2014-08-06 12:24:56.7868 9318/7f68e1619780 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.9308/generation-0/logging
[ 2014-08-06 12:24:56.7869 9309/7f411e11c780 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[Wed Aug 06 12:24:56.789541 2014] [ssl:warn] [pid 9308] AH02292: Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
[Wed Aug 06 12:24:56.789561 2014] [suexec:notice] [pid 9308] AH01232: suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec)
[Wed Aug 06 12:24:56.831685 2014] [auth_digest:notice] [pid 9329] AH01757: generating secret for digest authentication ...
[ 2014-08-06 12:24:56.8356 9336/7fc39f3d4780 agents/Watchdog/Main.cpp:538 ]: Options: { 'analytics_log_user' => 'nobody', 'default_group' => 'nogroup', 'default_python' => 'python', 'default_ruby' => '/usr/bin/ruby', 'default_user' => 'nobody', 'log_level' => '0', 'max_pool_size' => '6', 'passenger_root' => '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini', 'passenger_version' => '4.0.37', 'pool_idle_time' => '300', 'temp_dir' => '/tmp', 'union_station_gateway_address' => 'gateway.unionstationapp.com', 'union_station_gateway_port' => '443', 'user_switching' => 'true', 'web_server_passenger_version' => '4.0.37', 'web_server_pid' => '9329', 'web_server_type' => 'apache', 'web_server_worker_gid' => '33', 'web_server_worker_uid' => '33' }
[ 2014-08-06 12:24:56.8386 9339/7fc18f955780 agents/HelperAgent/Main.cpp:643 ]: PassengerHelperAgent online, listening at unix:/tmp/passenger.1.0.9329/generation-0/request
[ 2014-08-06 12:24:56.8446 9345/7f54b9745780 agents/LoggingAgent/Main.cpp:321 ]: PassengerLoggingAgent online, listening at unix:/tmp/passenger.1.0.9329/generation-0/logging
[ 2014-08-06 12:24:56.8448 9336/7fc39f3d4780 agents/Watchdog/Main.cpp:728 ]: All Phusion Passenger agents started!
[Wed Aug 06 12:24:56.861531 2014] [proxy:crit] [pid 9329] AH02432: Cannot find LB Method: byrequests
[Wed Aug 06 12:24:56.861563 2014] [:emerg] [pid 9329] AH00020: Configuration Failed, exiting

Could you try running this command:

a2enmod lbmethod_byrequests

You should then see output indicating that Apache is enabling a module. Once you receive that, then try restarting Apache:

/etc/init.d/apache2 restart

Oh yes it's much better. If I install the module before the script, I don't have any problem with apache anymore, but Ghost will still not work. In the script management, server is down (node.js I guess) even if I try to put it online, and if I try to refresh the page where it's installed, I get:

[Wed Aug 06 19:46:58.934876 2014] [proxy:error] [pid 9775] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:3001 (localhost) failed
[Wed Aug 06 19:46:58.934924 2014] [proxy:error] [pid 9775] AH00959: ap_proxy_connect_backend disabling worker for (localhost) for 60s
[Wed Aug 06 19:46:58.934938 2014] [proxy_http:error] [pid 9775] [client 123.118.112.103:53543] AH01114: HTTP: failed to make connection to backend: localhost

Jamie, I did some testing on the Ghost Install Script, which uses Node.js.

It looks like there's a problem where Node.js can't be put into a directory named "ghost" (I'm assuming that this somehow conflicts with the application name).

When doing so, Node throws this error:

> ghost@0.4.2 start /home/test/public_html/ghost
> node index

|
ERROR: Your site url in config.js cannot contain a subdirectory called ghost.
http://test.com/ghost
Please rename the subdirectory before restarting
Error: Your site url in config.js cannot contain a subdirectory called ghost.
    at validateConfigEnvironment (/home/test/public_html/ghost/core/bootstrap.js:83:25)
    at NearFulfilledProxy.when (/home/test/public_html/ghost/node_modules/when/when.js:501:43)
    at Promise._message (/home/test/public_html/ghost/node_modules/when/when.js:426:25)
    at Array.deliver [as 0] (/home/test/public_html/ghost/node_modules/when/when.js:319:7)
    at runHandlers (/home/test/public_html/ghost/node_modules/when/when.js:385:12)
    at Array.2 (/home/test/public_html/ghost/node_modules/when/when.js:352:5)
    at runHandlers (/home/test/public_html/ghost/node_modules/when/when.js:385:12)
    at drainQueue (/home/test/public_html/ghost/node_modules/when/when.js:836:3)
    at process._tickCallback (node.js:419:13)

Naming the installation directory to anything else, such as "ghost2", works fine.

Could we prevent it from using "ghost" as the installation directory?

Sure, I will update the installer to prevent this. That seems pretty surprising though, as I'd expect "ghost" to be the normal sub-directory name!

Okay Arvi89, this should now be corrected for future Virtualmin versions, but for the time being, try performing the Ghost installation into a directory that isn't named "ghost". Any name other than that should work fine.

Ok, now it doesn't crash anymore, but not really working :(

After the installation, it tells me to go to /directory/ghost/, that redirects me to /ghost/, so obviously it doesn't work. I then tried to go to /directory/, it gives me a 404 from ghost (but a broken 404, it tries to load a picture from /ghost/img/404-ghost.png)

It looks like there are still some outstanding problems with the Ghost Install Script on Ubuntu 14.04.

We're not quite sure what's causing all the issues yet, but we're working on them. We're able to reproduce the problems you're seeing.

In the meantime, while we're working on the issues with Ghost/Node.js, if you had any other Install Scripts that you were having problems with, we could go over those :-)

Hello!

I have been away for a while, I just re-installed my server without using ldap this time for users (it made things complicated and my installation was not "normal"). I just tried to install ghost, but ghost is using the port 80, so it can't work with apache in the same time...

Still same configuration, Ubuntu server 14.04.

Are you installing Ghost via Virtualmin? It should get configured to use a different port, and then apache is proxied through to it.

yeah, I did everything from virtualmin. Actually I didn't exactly check that it was using port 80, but just after I finished the installation, apache stopped, and I couldn't start it again (I think it was because port was used, but not 100% sure). Was fixed just after I uninstalled ghost (that also uninstalled nodejs then).

I'm not seeing this problem in my test installs - ghost is always using the correct port assigned by Virtualmin.

Ok, you're right, was another problem, I had to manually activate the lbmethod_byrequests module, it was not activated, but needed.

Still not working. When I go to /ghostblog/ghost (link provided at the end of the installation, all default settings), it tells me: Cannot GET /ghost

I've updated the Ghost script installer to fix the issue of installing into a sub-directory.

Looks like the node.js install is failing due to missing dependencies on your system (ie. sqlite).

Try first running apt-get install sqlite3