Apache cookbook fail to start - apache2

I have followed the steps from Opscode Youtube video to create apache cookbook.
~/chef-repo/cookbooks/apache/recipes/default.rb
package "apache2" do
action :install
end
service "apache2" do
action [:enable, :start]
end
cookbook_file "/var/www/index.html" do
source "index.html"
mode "0644"
end
but chef-client failed.
Running handlers: [2014-10-31T10:58:27+08:00] ERROR: Running exception
handlers Running handlers complete [2014-10-31T10:58:27+08:00] ERROR:
Exception handlers complete [2014-10-31T10:58:27+08:00] FATAL:
Stacktrace dumped to /var/chef/cache/chef-sta cktrace.out Chef
Client failed. 0 resources updated in 1.137832751 seconds
[2014-10-31T10:58:27+08:00] ERROR: service[apache2] (apache::default
line 14) ha d an error: Mixlib::ShellOut::ShellCommandFailed:
Expected process to exit with [0], but received '1'
---- Begin output of /etc/init.d/apache2 start ---- STDOUT: * Starting web server apache2 Action 'start' failed. The Apache error log may
have more information. ...fail! STDERR: (98)Address already in use:
make_sock: could not bind to address 0.0.0.0 :80 no listening
sockets available, shutting down Unable to open logs
---- End output of /etc/init.d/apache2 start ---- Ran /etc/init.d/apache2 start returned 1 [2014-10-31T10:58:27+08:00]
FATAL: Chef::Exceptions::ChildConvergeError: Chef ru n process
exited unsuccessfully (exit code 1)

Something else is already listening on port 80 (Address already in use). You can use the command sudo netstat -ltnp to check what it is.

Related

Payara 5 doesn't start in debug mode

I'm new to Payara server and I tried just a simple *.war example to run it on Payara 5.193 Full version. If I start it with asadmin start-domain everything is fine. If I want to start it in debug mode with asadmin start-domain --debug true the windows console shows following:
Waiting for domain1 to start .Error starting domain domain1.
The server exited prematurely with exit code 2.
Before it died, it produced the following output:
ERROR: transport error 202: gethostbyname: unknown host
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [debugInit.c:750]
The log file shows the start parameters like it does in "normal" mode and stucks.
The environment I use:
Payara Server 193.1 Full
JDK 1.8.0_131-b11
Windows 10
I've also tried to switch off my Firewall.

error on start nginx service on ubuntu vps

i am begginer user of vps, i have a reactJS app, and i wnat to deploy it on my ubuntu 18 vps with nginx.
I have followed the stpes of this tutorial Deploying create-react-app with Nginx and Ubuntu
i had already check all the steps, but when i put the command
sudo service nginx start
the system show's me, the next error message:
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for details.
and when i put "journalctl -xe" shows me this:
nginx, error
ngnix, error
please help me friends
Look in your log file on messages before the error "Failed to startup nginx"
You will see the reason of problem.
bind() to 0.0.0.0:80 failed (98: Address already in use)
Looks like port 80 on your vps server is already in use by some application.
Port 80 used for HTTP services.
So most likely you already have run Apache HTTP server, or some other.
use this command to see what application use it
sudo netstat -tulpn | grep ":80"
If you see apache
tcp6 0 0 :::80 :::* LISTEN 349/apache2
then you can stop apache
# apache service name also can be httpd (use right command)
# sudo service httpd stop
sudo service apache stop
and run nginx
sudo service nginx start
But you should be sure that you don't use apache for another website.

PostgreSQL starts for a few minutes, then fails

I recently moved my PostgreSQL data_directory from /var/lib/pgsql/data to /home/databasepostgre/. I have followed these steps from
$sudo systemctl stop postgresql-9.4.service
edit postgresql.conf data_directory to /home/databasepostgre/pgsql/9.4/data
$sudo rsync -av /var/lib/pgsql/9.4/data /home/databasepostgre/pgsql/9.4/data
$su postgres
psql
SHOW data_directory; "it shows new directory which is /home/databasepostgre/pgsql/9.4/data"
systemctl start service
But each time i execute step #6, I always end up with this error :
Job for postgresql-9.4.service failed because a timeout was exceeded. See systemctl status postgresql-9.4.service and journalctl -xe for details.
From journalctl -xe the error is as follows:
May 11 13:35:04 systemd[1]: postgresql-9.4.service start operation timed out. Terminating.
May 11 13:35:04 systemd[1]: Failed to start PostgreSQL 9.4 database server.
-- Subject: Unit postgresql-9.4.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql-9.4.service has failed.
--
-- The result is failed.
May 11 13:35:04 systemd[1]: Unit postgresql-9.4.service entered failed state.
May 11 13:35:04 systemd[1]: postgresql-9.4.service failed.
Can anyone please help me? This is a production server and I still cannot find the issue and how to solve it.

MongoDB, issues with configuring and starting

I am new to mongoDB and i am trying to get it configured and running on my Ubuntu server. When i go and enter this command in my terminal
sudo service mongod start
I get the following output
start: Job is already running: mongod
So, when i try to enter the shell with
mongo
I get the following output
2015-02-24T14:54:39.557-0800 warning: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2015-02-24T14:54:39.559-0800 Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146
I know I'm not working locally so I heard over to the mongod.conf file and change the following
port = 5000
# Listen to local interface only. Comment out to listen on all interfaces.
bind_ip = 10.0.1.51
Where bind_ip is now my ubuntu server and the port is 5000 as shown, so now i restart the service with
sudo service mongod restart
and outsputs
mongod start/running, process 1755
And now I try to renter back into shell with
mongo
and i still get the same error messages
MongoDB shell version: 2.6.7
connecting to: test
2015-02-24T15:01:26.229-0800 warning: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2015-02-24T15:01:26.230-0800 Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146
exception: connect failed
Can someone help me out with this issue? I've been going through the forums and nothing appears to be working. Thanks.
If anyone is having trouble, i looked into mongod --help and found the following solutions
mongod --smallfiles
or
mongod --nojournal
hope this helps anyone.

Glide/Gaelyk/Groovy: Error deploying to Google App Engine: Can’t enter oauth2 token

As part of the deployment process of a Glide project (http://glide-gae.appspot.com/docs/intro step 3 of 2nd section) you need to authenticate using oauth2. My browser popped up with the token as expected but the process didn’t wait for me to copy the code in, it just carried on with the following error...
22:30:12.713 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] Daemon is busy, sleeping until state changes.
22:30:12.733 [INFO] [org.gradle.launcher.daemon.server.exec.LogToClient] About to start relaying all logs to the client via the connection.
22:30:12.734 [INFO] [org.gradle.launcher.daemon.server.exec.LogToClient] The client will now receive all logging from the daemon (pid: 12557). The daemon log file: /.gradle/daemon/1.8/daemon-12557.out.log
22:30:12.739 [DEBUG] [org.gradle.launcher.daemon.server.SynchronizedDispatchConnection] thread 14: received class org.gradle.launcher.daemon.protocol.CloseInput
22:30:12.740 [DEBUG] [org.gradle.launcher.daemon.server.DefaultDaemonConnection] Received IO message from client: CloseInput[id=069864b2-2948-4a9d-abea-0705274136a1.2]
22:30:12.741 [INFO] [org.gradle.launcher.daemon.server.exec.ForwardClientInput] Closing daemon's stdin at end of input.
22:30:12.742 [INFO] [org.gradle.launcher.daemon.server.exec.ForwardClientInput] The daemon will no longer process any standard input.
22:30:12.747 [INFO] [org.gradle.launcher.daemon.server.exec.ExecuteBuild] Executing build with daemon context: DefaultDaemonContext[uid=3901cff0-8d50-41b6-9459-e31f7b78f1e3,javaHome=/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home,daemonRegistryDir=.gradle/daemon,pid=12557,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-Xmx512m,-Dfile.encoding=UTF-8]
Please enter code: Encountered a problem: No line found
Please see the logs [/var/folders/c8/vx2jf50j68x1z3_pysy6kxjm0000gp/T/appcfg2389447403250678065.log] for further information.
Daemon vm is shutting down... The daemon has exited normally or was terminated in response to a user interrupt.
----- End of the daemon log -----
org.gradle.tooling.GradleConnectionException: Could not execute build using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.8-bin.zip'.
What can I do to be able to deploy my application? How can I force the process to wait for me to enter the code?
If that's (glide deploy) not working for you, the easiest option is to export the app as a standard gradle project and then execute the gaeUpdate task.
glide -a somedir/yourapp -o where/you/want/to/export/app export
Note that the export is command at the end, -o tell the location where it should be exported.
Then from the exported project run: gradle gaeUpdate
A work around is to manually set your credentials in the GAE build.gradle file.
Update the following file:
/glide/install/generated/app-name/build.gradle
appcfg {
email = ‘email-address'
password = ‘password'
app {
id = ‘app-id'
}
}
This means that the values from the __glide.groovy file are ignored, but at least you can get the application deployed

Resources