How to restart Apache web server?

Searched the net but cannot even find how to restart Apache web server in Sun.  
SunOS 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.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.
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.
Brad HoweDevOps ManagerCommented:

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

# su -
enter rootpassword

   # /apache/apache-2.2.13/bin/apachectl stop
   # /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".

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

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.
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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
lapuccaAuthor Commented:
My userid is not root.  I type root to login but I don't have password for that.
Brian UtterbackPrinciple 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.
lapuccaAuthor Commented:
I was able to restart using /apache/bin/apachectl restart.  Thanks to everyone's help.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.