WebFaction
Community site: login faq

I am having problems restarting apache2. Here is the error I am getting:

[greg0274@web373 bin]$ /bin/bash: source /home/greg0274/envs/pinax072/bin/activate LD_LIBRARY_PATH=/home/greg0274/webapps/icollct/apache2/lib /home/g: No such file or directory
-bash: /bin/bash:: No such file or directory

Here is my start file:

#!/bin/bash source /home/greg0274/envs/pinax072/bin/activate LD_LIBRARY_PATH=/home/greg0274/webapps/icollct/apache2/lib /home/greg0274/webapps/icollct/apache2/bin/httpd.worker -f /home/greg0274/webapps/icollct/apache2/conf/httpd.conf -k start

asked 22 Dec '12, 18:20

greg0274
113
accept rate: 0%

edited 22 Dec '12, 20:00

ryans ♦♦
5.0k93160


It looks like your entire script is a single line. Try using a script format like this:

#!/bin/bash
source /home/greg0274/envs/pinax072/bin/activate
LD_LIBRARY_PATH=/home/greg0274/webapps/icollct/apache2/lib /home/greg0274/webapps/icollct/apache2/bin/httpd.worker -f /home/greg0274/webapps/icollct/apache2/conf/httpd.conf -k start
permanent link

answered 22 Dec '12, 20:00

ryans ♦♦
5.0k93160
accept rate: 43%

Yes it was, obviously I am a newbie. I had tried separating as you had shown, but got the following:

(pinax072)[greg0274@web373 ~]$ webapps/icollct/apache2/bin/restart
Apache is not running.
webapps/icollct/apache2/bin/restart: /home/greg0274/webapps/icollct/apache2/bin/start: /bin/bash^M: bad interpreter: No such file or directory
(22 Dec '12, 20:38) greg0274

The /bin/bash^M is the problem. That ^M character is a windows line ending (CRLF). They usually occur when you edit a file in windows and upload it to the server. You'll want to use a unix-aware text editor like notepad2, notepad++, or geany. Make sure you choose to use Unix line endings (LF) in the editor.

You can also just edit files directly on the server with vim, which is already installed.

You can use the dos2unix program on the server to convert files which have windows line endings to unix line endings.

Finally, if you happen to run linux or mac os x locally, then you would be using the correct line endings already, and don't need to worry about it.

Hope that helps!

(22 Dec '12, 20:49) ryans ♦♦

Thanks that did it.

(22 Dec '12, 21:22) greg0274
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×224

question asked: 22 Dec '12, 18:20

question was seen: 1,665 times

last updated: 22 Dec '12, 21:22

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM