How to restart Apache web server?

Searched the net but cannot even find how to restart Apache web server in Sun.  
SunOS cs-server.usc.edu 5.10 Generic_120011-14 sun4v sparc SUNW,SPARC-Enterprise                                                                              -T5220
System type is SUN4V with 65408 MB of memory.

What is the command to do this?  Thank you.
lapuccaAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
turnbulldConnect With a Mentor Commented:
Since you are running Solaris 10, it may be the case that you plan to use the apache that ships with the OS.  There are two instances, apache and apache2.  The apache instance is used primarily by internal stuff and probably should be left alone.  

The apache2 instance uses /etc/apache2/httpd.conf as its config file and has a service under Solaris.  You must edit this file and fix at least the following line before it will start:

The line:

   Group #-1

changes to:

   Group nobody

Make sure there is a nobody group in /etc/group too.

Once the httpd.conf file is correct, you start it using the root user with this command:

  svcadm enable apache2

You can stop it with this command:

  svcadm disable apache2

And you can re-read the config file after changes with this command:

  svcadm restart apache2

You can run these commands from any folder after connecting to the server as root or becoming root using the su -  command.  Please make liberal use of the man command:

  man svcadm
  man su
  man svcs

To determine if the service started, use this command:

  svcs apache2

If it remains disabled or goes into maintenance mode, check out the file /var/svc/log/network-http:apache2.log and /var/adm/messages to see what errors were thrown and take steps to resolve them.

The doc root is, by default, /var/apache2/htdocs.  Place your content there or configure httpd.conf to point to another doc root or add a directory specification.
0
 
yuzhCommented:
Assumpt that you have setup the webserver correct, and use the apache package comes with Solaris OS, and have edit the webserver configuration file /etc/apache/httpd.conf
to restart apache, login as root (or su as root), type in:
/etc/ec3.d/S50apache restart
you can look at the startup script /etc/ec3.d/S50apache  for more details.
0
 
lapuccaAuthor Commented:
Sorry, very new in Unix world.  From where do I enter this command?  I tried at my home directory and from my /apache directory and got " Command not found."
Thank you.
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Brad HoweConnect With a Mentor DevOps ManagerCommented:
Hi,

To restart apache you need to be under the ROOT user. Open a terminal window and type the following

# su -
enter rootpassword

TO STOP
   # /apache/apache-2.2.13/bin/apachectl stop
TO START
   # /apache/apache-2.2.13/bin/apachectl start

The location of your installation may/will be different. just change the path but the application is "apachectl".

Cheers,
Hades666
0
 
yuzhCommented:
FYI, do not type in the #,   login as root or su as root, then type in:
/etc/ec3.d/S50apache restart
If you have no experience with Unix, you can ask some with soem Unix experience to read this page, he can help you out.
0
 
lapuccaAuthor Commented:
My userid is not root.  I type root to login but I don't have password for that.
0
 
Brian UtterbackConnect With a Mentor Principle Software EngineerCommented:
Only the root user will be able to restart the system apache server, unless you started the server in the first place as a regular user. If Apache is started pointing to a separate
conf file that points to only user owned files and binding only to non-priv ports, (e.g. 8080) then it is possible to run Apache as a regular user and you could restart it. Otherwise you will need to be root to restart it.
0
 
lapuccaAuthor Commented:
I was able to restart using /apache/bin/apachectl restart.  Thanks to everyone's help.
0
All Courses

From novice to tech pro — start learning today.