LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-14-2013, 07:13 PM   #1
call_krushna
Member
 
Registered: Aug 2007
Location: India
Distribution: Ubuntu
Posts: 173

Rep: Reputation: 1
restarting apache and liferay remotely is not working for apache proxy remotely


Hi Team,

We have liferay configured box which we are accessing using apache (http-proxy ) server externally .
We have build server(Bamboo) which remotely updates the liferay and restart liferay with each deployment .

The problem is now , once deployment done using bamboo , we have to start apache and liferay in respective servers as follows .

In apache server. Need to hit the command


$sudo su
#/etc/init.d/apache2 restart

$sudo su
#Liferay_Home/bin/liferay restart

After using the above command , liferay works fine with apache proxy . But if we start

start respective service as follows ,it is not working .

In apache server

$sudo /etc/init.d/apache2 restart

In liferay server

$sudo /liferay_home/bin/liferay restart

After hitting the above command , liferay working locally but not working externally using Apache .

We are getting a response in browsed like temporarily service unavailable

Here are my doubts .

How to start liferay and apache as root remotely .
We have only one user ubuntu in our server .

The whole idea here is to automate everything in the deployment .Once we are able to restart the services as root , we can add the command in the deployment script itself ,so that once deployment done, it will start liferay and apache remotely .

Any help is highly appreciable .
 
Old 05-16-2013, 09:35 AM   #2
kbscores
Member
 
Registered: Oct 2011
Location: USA
Distribution: Red Hat
Posts: 259
Blog Entries: 9

Rep: Reputation: 32
There is a line within the sudoers file :
Defaults requiretty

which will not allow sudo to be ran remotely - you comment that line out it should allow sudo to be ran remotely. --Just be cautious with this because allowing sudo to be ran remotely does open up vulnerabilities.
 
Old 05-16-2013, 11:31 AM   #3
call_krushna
Member
 
Registered: Aug 2007
Location: India
Distribution: Ubuntu
Posts: 173

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by kbscores View Post
There is a line within the sudoers file :
Defaults requiretty

which will not allow sudo to be ran remotely - you comment that line out it should allow sudo to be ran remotely. --Just be cautious with this because allowing sudo to be ran remotely does open up vulnerabilities.

Hi kbscores ,

Thanks for reply .I am trying below way to restart the service .

ssh -i /home/bamboo/.ssh/mykey.pem ubuntu@www.staging.mydomain.com -o "StrictHostKeyChecking no" "sudo $Liferay_home/bin/liferay stop"
ssh -i /home/bamboo/.ssh/mykey.pem ubuntu@apacheproxy.staging.mydomain.com -o "StrictHostKeyChecking no" "sudo service apache2 stop"
sleep 30
ssh -i /home/bamboo/.ssh/mykey.pem ubuntu@apacheproxy.staging.mydomain.com -o "StrictHostKeyChecking no" "sudo service apache2 start"
sleep 30
ssh -i /home/bamboo/.ssh/mykey.pem ubuntu@www.staging.mydomain.com -o "StrictHostKeyChecking no" "sudo $Liferay_home/bin/liferay start"


If run the above commands from remote server ,it is not working but as explained if logged in to server and run sudo su ; then start the service it is working .
 
Old 05-16-2013, 12:13 PM   #4
kbscores
Member
 
Registered: Oct 2011
Location: USA
Distribution: Red Hat
Posts: 259
Blog Entries: 9

Rep: Reputation: 32
Scratch that - I was thinking of using sudo for startup stuff. All you need is a -t for linux to make it work.

So...

Code:
ssh -t -i /home/bamboo/.ssh/mykey.pem ubuntu@www.staging.mydomain.com -o "StrictHostKeyChecking no" "sudo $Liferay_home/bin/liferay stop"
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Acess apache remotely on slackware 13.1 Willian Linux - Server 50 11-20-2010 04:03 PM
Cannot Access Apache Web URLs Remotely eliassal Linux - Server 4 06-08-2010 09:31 AM
Help - Setting up Apache/CGI/Perl remotely - Redhat/Putty shallowfellow Linux - Server 1 12-13-2007 03:36 PM
Can't access Apache remotely zwyrbla Linux - Software 7 03-23-2005 07:14 PM
Editing webpages on Apache remotely patpawlowski Linux - Software 2 02-07-2004 12:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration