How to install Apache 2 on Windows 10? - windows

I want to install an Apache 2 server on a Windows 10 system. The official documentation (https://httpd.apache.org/docs/2.4/platform/windows.html) states that:
"The Apache HTTP Server Project itself does not provide binary releases of software, only source code"
To have a binary of the Apache HTTP Server it has to be compiled by oneself or acquired from a distribution provided by a thrid party. These distributions usually bundle Apache with PHP and MySQL.
The question is:
What distribution is recommended to install a standalone Apache 2 server and what are the steps to do it?

I have used the Apache Lounge distribution indicated in the official Apache 2 documentation (https://httpd.apache.org/docs/2.4/platform/windows.html)
These are the steps to install Apache on Windows using Apache Lounge distribution:
Download Apache 2.4.37 Win64 (https://www.apachelounge.com/download/)
Create folder C:/Apache24
Unzip httpd-2.4.37-win64-VC15.zip in folder C:/Apache24
Option 1: To run it from the console:
Open Windows Power Shell
Execute httpd.exe
PS > C:\Apache24\bin\httpd.exe
or
PS > cd C:\Apache24\bin
PS > .\install.exe
Open http:\localhost or http:\127.0.0.1 in brwoser
The message It works! will be displayed
Option 2: To install it as a service:
Open Windows Power Shell
Open Windows Power Shell as administrator
PS > Start-Process PowerShell -Verb RunAs
Install the service
PS > cd C:\Apache24\bin
PS > .\httpd.exe -k install
Start the service
PS > .\httpd.exe -k start
or through the services administrator
PS > services.msc
Select Apache2.4 > Right-click > Start
Open http:\localhost or http:\127.0.0.1 in brwoser
The message It works! will be displayed

Easy:
Download from apache lounge https://httpd.apache.org/docs/2.4/platform/windows.html
Go into downloaded zip folder and move the Apache24 folder to C:/
Open terminal to C:/Apache24/bin and execute httpd.exe
done!
Now type "localhost" into your browser and a message "It works" should appear on screen.

Related

tomcat a service with the given service name is already installed

I have to uninstall tomcat before reinstall it.But, I mistakenly deleted the file folder first and then uninstalled it from "control Panel", during this process I think somewhat might be got wrong. Now when I am trying to install it it is giving me the message:-
How can I overcome this?
it means that you have already installed a version of tomcat8 on your pc. But you can fix this problem by opening the cmd in administrator mode. then you start the command:
sc.exe delete tomcat8
That is because the server is not fully out of your computer, here follow these steps to remove the existing server on windows:
Navigate to Control Panel.
Open Administrative tools.
Open SERVICES.
You will find Apache tomcat version name, right click on it and open properties.
Cope the name of the server: Tomcat8/Tomcat9.
Now open and run the command prompt as an administrator:
https://www.thewindowsclub.com/how-to-run-command-prompt-as-an-administrator
Write the command: sc Delete Tomcat8/Tomcat9 and hit enter, the existing server is
removed and you are all set to install a new one.

Windows Jenkins slave issues

I upgraded to the latest version of Jenkins, and now when I try to run a Jenkins build on a Windows slave I get the error: Unable to find a suitable SSH agent.
I followed the instructions here: https://issues.jenkins-ci.org/browse/JENKINS-28279
But they no longer work. I'm using Jenkins version 2.33
My suggested set up:
Install Jenkins Master as a Windows Service.
On the Master:
Navigate to Nodes.
Create a new node and give it a name like Node.
Set Description to "Slave for Deployments to "
Set # Executors to 5
Set Directory to C:\JenkinsSlave
On the Slave machine:
Open a browser to Jenkins Master URL
Navigate to Nodes > <New Slave Name>
Click the Launch button. A new (small) browser window will open.
ALTERNATE - If launch button wants to download slave-agent.jnlp
a) Save slave-agent.jnlp to c:\temp on slave machine
b) Ensure Java 1.8_66 is installed and %JAVA_HOME%\bin is in the Path (NOTE: %JAVA_HOME% may not work so you may have to put the full path to Java in the Path)
c) Open an Administrator Command Prompt and navigate to c:\temp
d) Type javaws -verbose c:\temp\slave-agent.jnlp
e) Accept the "Do you want to run" dialogs
f) When the browser window pops up select "Install as a Windows service" from the file menu
g) If installation fails due to access rights you will need navigate to C:\JenkinsSlave and type jenkins-slave.exe install
Select File > "Install as a windows service"
Go to Services > JenkinsSlave and open properties
Set Logon details appropriately and restart.
If "Install as a windows service" fails
On the slave machine:
Open an adminstrator Command Prompt
Change directory to C:\JenkinsSlave
Execute "slave.exe install" (without the quotes)
Return to step 5. above.

Install Liferay as Windows 2012R2 service

I am a newbie on Liferay and furthermore 100% Windows infrastructure knowledge based. I installed Liferay 6.2 on my Windows 2012R2 server together with Java jdk-8u5 version. All is running perfect as long as I am logged in as user on the Server via remotedesktop having open the tomcat startup.bat window.
What have I to do exactly to start Liferay and/or tomcat as service?
Thanks in advance for your efforts.
Configuring liferay or tomcat to run as a service on a windows server doesn't differ that much.So in order to do that you have to add some files to the LIFERAY_HOME\tomcat\bin directory.
To get those files you have to download a full version of 64-bitWindows tomcat from here :
http://tomcat.apache.org/download-70.cgi.
Extract the zip and go to the bin directory, copy service.bat , tomcat7.exe and tomcat7w.exe to this location : LIFERAY_HOME\tomcat\bin
Setting Up the service
Open the commad prompt (Make sure you have admin rights or run the command prompt as administrator),In Command Prompt go to LIFERAY_HOME\tomcat\bin and Execute the following command
service.bat install tomcat7
This will install the tomcat6 service in windows.
Now execute following commond to setup additional configuration for the service
tomcat7w.exe ES tomcat7.exe
2 . Extra configuration :
-XX:MaxPermSize=512m
-Dfile.encoding=UTF8
-Duser.timezone=GMT
-Djava.security.auth.login.config="%CATALINA_HOME%/conf/jaas.config"
-Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false
and make sure to provide enough memory for your service by setting the initial memory pool and the maximum one.
Either go with Rafik Beldi's answer (quite an effort, wow) or just go to tomcat's documentation in case you're still missing some information
I had to delete what was in Java Options completely or it wouldn't start: and then I entered:
-XX:MaxPermSize=512m
-Dfile.encoding=UTF8
-Duser.timezone=America/New_York
-Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false
-Djava.net.preferIPv4Stack=true
note that where I am: America/New_York allows for both EST and EDT

How to setup "svnserve --service" to run on Windows?

When starting from cmdline
svnserve.exe -d -r d:\svn\mytools
all working fine.
Then I had tried to set it up to run as Windows service:
#echo off
set SvnHome=C:\Program Files\TortoiseSVN
set SvnRepository=D:\Svn\mytools
sc delete SvnMyTools
sc create SvnMyTools binPath= "%SvnHome%\bin\svnserve.exe --service -r %SvnRepository%" start= delayed-auto type= share
service was installed but it is unable to start.
All the time it is reporting an error
Error 1083: The executable program that this service is configured to run in does not implement the service.
I have tried to edit service cmdline using regedit, so tried to add double quotes arround ref to exe, tried to change cmdline parameters (used -d instead of --service, used both -d and --service) and so on. Sometimes reported errors are looks a bit different but it does not work anyway. :-(
Question is - how to setup it to make it working as service on Windows 7 x64?
Is it possible at all? I mean - if that "--service" cmdline switch is able to work in svnserve?
Note: svnserve version is 1.7.9 (r1462340).
Rest of TortoiseSVN components are 1.7.12.24070.
Thanks in advance.
It took me a while to figure out that the selected answer was not final, but a supplement to the question. This is the final one line command to execute:
sc create svnserve binpath="\"C:\Program Files\TortoiseSVN\bin\svnserve.exe\" --service -r D:\Repositories" displayname="Subversion Server" depend=Tcpip start=auto
Looks fine to me. My server is installed with this binary path:
"C:\Program Files\Subversion\svnserve.exe" --service -r "D:\Repositories" --listen-port "3690"
Did you try to install it outside of a script?
I realize this is an old question, but in case you need to do this on a more current Windows OS version...
On Windows Server 2012 with CollabNet subversion Edge SVN v5.2.4, this syntax worked in an elevated cmd window (NOTE the space after the = character and where the quote " characters are located):
sc create svnserve binpath="E:\csvn\bin\svnserve.exe --service -r E:\csvn\data\repositories --listen-port 3690 --log-file E:\csvn\data\logs\svnserve.log" displayname="SVN Serve" depend= Tcpip start= auto
After creating the svnserve Windows service, to add a description :
sc description svnserve "SVN Server providing the svn:// or svn+ssh:// protocol scheme"
Screenshot of Services.msc showing the newly created svnserve service:
Reference: http://svnbook.red-bean.com/en/1.7/svn.serverconfig.svnserve.html

How to Manually create an Apache Windows Service

I accidentally removed my Apache windows service trying to install another Apache web server. Does anyone know how I can create another Apache windows service from cmd? I tried "sc create ..." but I am missing a script on the end like -k start? Not sure what I need for the end of it...
I am running Apache 2.2
Thank you
On Apache 2.4 the executable have changed name to httpd.exe, the command would be:
httpd.exe -k install -n "Apache2.4"
With a name switch in order to give the service a distinct name.
For older versions of Apache:
Apache.exe -k install
net start apache2
Click Win + R and type cmd
Below Image shows how to install Apache2.2 in windows
Default installation location of Apache2.2 is C:\Program Files\Apache Software Foundation but in my pc I installed directly on C:/ drive.
If you want to install Apache2.2 in Program Files folder then in type in command prompt as follows
C:\>cd Program Files ( Click Enter )
C:\>Program Files>cd Apache Software Foundation ( Click Enter )
C:\Program Files\Apache Software Foundation>cd Apache2.2 ( Click Enter )
C:\Program Files\Apache Software Foundation\Apache2.2>cd bin ( Click Enter )
in bin folder you will find httpd.exe file
C:\Program Files\Apache Software Foundation\Apache2.2\bin>httpd.exe -k install( Click Enter)
The successuful message is displayed in command prompt like above shown in the image.
On Apache 2.2, the command is:
httpd.exe -k install
In Windows 7 or 8 right click the XAMPP Control Panel start (menu) shortcut and Run As Administrator. Then just click the service check boxes for Apache and/or MySQL.
Did not work for me using httpd.exe -k install, I had to register apache as a service using sc.exe using:
sc.exe create apache2.4 start= auto obj= "<account>" password= "<password>" DisplayName= "Apache 2.4" depend= "Tcpip/Afd" binpath= "\"c:\wamp\bin\apache\apache2.4.33\bin\httpd.exe\" -k runservice"

Resources