I am not able to Start Apache on XAMPP on my system windows 7 32 bit - apache

I am not able to run/start Apache through XAMPP on my system windows 7 32 bit. The problem is after installing everything is working okay but Apache is not running or starting.
Getting the following error message:-
Initializing Control Panel Windows Version: Windows 7 Ultimate 32-bit
Initializing module...
Checking for module existence...
Checking for required tools...
Checking for service (name="Apache2.4"): Service installed
error message : Apache Service detected with wrong path
Change XAMPP Apache and Control Panel settings or
Uninstall/disable the other service manually first
Found Path: "C:\Apache24\bin\httpd.exe" -k runservice
Expected Path: "c:\xampp\apache\bin\httpd.exe" -k
Checking default ports...
Executing "net start "Apache2.4""
Return code: 0
I think my system is missing Port 80 which is used by Apache server to run - even I checked it on my system but there is no such port 80 on my system.
How to resolve this issue?

Terminate/exit the programs like skype and other programs that are using the port 80 then start the appache server hope this will start the server. Once appache server start then you can start the skype or other programs. Or even you can change the port of appache server. You can follow this link for changing the server port.
How to change XAMPP apache server port?
Hop this will help you.

port 80 is a virtual port. It is being used by some other Program. Try executing netsh on command prompt.
The most common issue is skype. Refer this question to resolve it.

Apache Service detected with wrong path Change XAMPP Apache and Control Panel settings or Uninstall/disable the other service manually first Found Path: "C:\Apache24\bin\httpd.exe" -k runservice Expected Path: "c:\xampp\apache\bin\httpd.exe" -k
Your answer is on error message. The installed apache loaction is not inside the xampp folder. Try to reinstall or change the configuration.

I've encountered this issue on my Windows 10 environment. I've found that I've configured C:\xampp\apache\conf\extra\httpd-xampp.conf with a new SSLCertificateFile or SSLCertificateKeyFile in one of my virtual hosts that was not existing.
So in my httpd-xampp.conf I have the following:
## mywebsite.local config
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/mywebsite.local"
ServerName mywebsite.local
ServerAlias *.mywebsite.local
</VirtualHost>
<VirtualHost *:443>
DocumentRoot "C:/xampp/htdocs/mywebsite.local"
ServerName mywebsite.local
ServerAlias *.mywebsite.local
## these lines are for my local SSL, here is the issue
SSLEngine on
SSLCertificateFile "crt/mywebsite.local/server.crt" ## this path may not exist
SSLCertificateKeyFile "crt/mywebsite.local/server.key" ## or even this line may not exist
</VirtualHost>
I've found that the path from SSLCertificateFile and SSLCertificateKeyFile doesn't exist.
I've fixed it and not it's working.
All the best!

I had the exact same issue on my system, Windows 10 64bit. I realized that I had edited the httpd.conf file in accordance with a security course I was taking and it rendered my configuration erroneous.
My fix was to uninstall XAMPP from the XAMPP uninstaller located in the XAMPP folder to completely erase all associated files as well as registry files! This was important because I had to do this once before but the uninstaller did not function properly for some reason.
Anyways, completely uninstalling it and reinstalling it leaving all the default settings made it work again. I know how it sounds... delete and re-install, but it finally got my server running, so it might serve as a solution for you and anyone who finds this post. Image of the Apache and my SQL server running without throwing errors.
Also, I found this out recently:
If you are learning to use XAMPP through a website like stackskills, the modules may not alert you to common issues. For example, if you need to change a directory, from C:/XAMPP/Apache to C:/Hacking Software/XAMPP/Apache, (notice the space and lack of underscore in the first part of the directory "HackingSoftware", XAMPP will read the first "space" as the end of an argument, and so you need to have the entire directory written in quotes like this: "C:/Hacking Software/XAMPP/Apache" or write it with underscores C:/Hacking_Software/XAMPP/Apache.
This syntax also applies to the use of the "Alias" command. See this link for more info: http://httpd.apache.org/docs/2.4/mod/core.html#directory.
Use this as a resource for other issues: http://httpd.apache.org/docs/2.4/mod/directives.html

Related

How to proxy web requests to Lucee/Tomcat under Apache?

I'm having trouble setting Lucce to run on Apache in a CentOS 9 machine.
The steps I've followed are bellow:
Installed .run file from https://downloads.lucee.org
Left the default for apachectl, httpd conf and http modules (I've already checked and it seems they're correct, I can provide the values if you need)
Set Tomcat to run on port 8888, the default value (tomcat is in fact running because i can access it externally)
Accepted to install Apache connector
Accepted to install mod_cfml
Then, when Lucee is being installed, I get a post-install step error, mentioning that the installation may not complete correctly:
Error running /opt/lucee/sys/install_mod_proxy.sh -m install -t 8888 -f
/etc/httpd/conf/httpd.conf -c /usr/sbin/apachectl: apachectl: The "-M" option is
not supported.
apachectl: The "-M" option is not supported.
But the installation process ends and everything seems to be fine.
Tomcat is running (I can access through domain.com:8888)
Proxy is added to httpd.conf file with the following rules
<IfModule mod_proxy.c>
ProxyPreserveHost On
ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ http://127.0.0.1:8888/$1$2
ProxyPassMatch ^/(.+\.cfml)(/.*)?$ http://127.0.0.1:8888/$1$2
# optional mappings
#ProxyPassMatch ^/flex2gateway/(.*)$ http://127.0.0.1:8888/flex2gateway/$1
#ProxyPassMatch ^/messagebroker/(.*)$ http://127.0.0.1:8888/messagebroker/$1
#ProxyPassMatch ^/flashservices/gateway(.*)$ http://127.0.0.1:8888/flashservices/gateway$1
#ProxyPassMatch ^/openamf/gateway/(.*)$ http://127.0.0.1:8888/openamf/gateway/$1
#ProxyPassMatch ^/rest/(.*)$ http://127.0.0.1:8888/rest/$1
ProxyPassReverse / http://127.0.0.1:8888/
</IfModule>
mod_cfml is loaded in httpd.conf file
LoadModule modcfml_module modules/mod_cfml.so
CFMLHandlers ".cfm .cfc .cfml"
ModCFML_SharedKey "{{ shared_key_here }}"
LogHeaders false
LogHandlers false
LogAliases false
VDirHeader false
In the end I restarted Lucee and Apache services and created a index.cfm file in /var/www/html, but when I try o access it I get a 503 error.
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
Catalina.out logs from tomcat and error_logs from apache dont give me any hints on whats happerning.
Can anyone point me any direction to solve this?
Any additional info you may need in order to help me fell free to ask.
Thanks.
So I found that my machine had SE (Security Enhanced) enabled, and there was a setting that prevented the request to be correctly proxied to tomcat, which is httpd_can_network_connect.
I had to run /usr/sbin/setsebool httpd_can_network_connect true in order to make it work, after this and restarting httpd service, everything was ok!

How to change the apache user for a virtual host in Centos 7?

I am trying to set up a web server on Centos 7. I have created a virtual host by editing /etc/httpd/conf/httpd.conf. The root directory of the virtual host was set to /var/www/html/domain.com. I am able to open domain.com in the browser with no issue.
However, when I use get_current_user() in a PHP file to test what user the server is running under, the output is "root" which is a security concernt.
How do I change the user of the virtual host? When I set up a similar scenario in Ubuntu, I used apache2-mpm-itk module and configured the virtual host with "AssignUserID your_username your_username" and it did the trick. But I don't know how to do it in Centos.
Thanks
You can try to use SuexecUserGroup for that.
I found this method from plesk's configuration.
<VirtualHost *:80>
<IfModule mod_suexec.c>
SuexecUserGroup "anyuser" "anygroup"
</IfModule>
/VirtualHost>
In CentOS, this command gives you the file's owner, not the owner of the process ID. Something like that. It's in the PHP manual. Check out the comments at the bottom. get_current_user() By the way, check your User and Group directives in the httpd.conf and in httpd-vhost.conf. Also, use ps -faux to get a clear idea of the process spawning relationships between the httpd binary and the children it spawns. Just trying to help. ;-)
Also, check out How Apache Starts at the top of this page to make sure you understand how Apache is supposed to work by default. If yours in not working this way, that may be a good thing to know!! ;-)
In CentOS 7 you can use the httpd-itk package. It is in the EPEL repository, so you need to add that first. Something like this should get it:
yum install epel-release
yum install httpd-itk
Once installed you need to load the module by uncommenting the LoadModule line in:
/etc/httpd/conf.modules.d/00-mpm-itk.conf
Restart the httpd, and then you can use the new AssignUserID directive inside your VirtualHost sections.
have you looked into which user/group is specified in /etc/httpd/conf/httpd.conf? It would look something like this:
User apache
Group apache

The Requested Operation has failed- Apache error

When I'm trying to start the Apache 2.2 server it is showing the following message: The Requested Operation has failed
In command Prompt it is showing as follows:
C:\Documents and Settings\amth>net start apache2.2
The Apache2.2 service is starting.
The Apache2.2 service could not be started.
A service specific error occurred: 1.
More help is available by typing NET HELPMSG 3547.
Open run( win + r ) in windows and then type services.msc. Search for Apache service. Double click on the service and select any startup type other than disabled. This should work like a charm.
Open conf folder then open httpd.conf file in your text editor.
Find this line:
Listen 12.34.56.78:80
Listen 80
and change it to
Listen 12.34.56.78:80
Listen 8080
Then hit save
I have wasted a whole day on figuring out why curl_init() threw an undefined-error. Im using Windows, Apache 2.4 and PHP 7.3
After trying to:
Install a fresh version of Curl As described in this post
Enabe Curl in the php.ini file following this description
I still got this error.
The solution was to add the directory of the php e.g c:php/ to the PATH Variable in the Windows environment variables.
->Hit the Windows-Key and S
-> search for "System"
-> go to advanced options(a small window shuld pop up)
-> hit environment variables
-> in the **bottom** box scroll until you find "PATH"
-> select it and hit "edit"
-> enter the php directory and close the window
-> reboot your PC
Hopefully it will work for you too :)
Have you done any changes in httpd.conf file ? i was also facing same problem in my case i have saved httpd.conf file as txt so due to that i was getting error
Was getting this issue when trying to start Apache with mod_jk. As part of loadmodule in http.conf file LoadModule jk_module modules/mod_jk.so was added but in Apache2.2\modules folder mod_jk.so file was not available. Added mod_jk.so file to modules folder and apache started without any issues.
Here is what I did - if you uninstall and reinstall apache via command prompt it
httpd -k unistall/httpd -k install
then it displays the errors
in my case the require all was missing 'granted' at the end of to look like 'require all granted'
<Directory />
AllowOverride all
Require all
</Directory>
If your lan ip changed then you would come across this error. In the httpd conf file you to rectify the following:
Listen IP:Port
I ran into the same error message on Windows Server 2008 R2. I was using SSL and realized that my signer certs, configured in ssl.conf, where placed in the wrong folders on the file system. I placed the certs in the correct spot and the service and Apache was working fine afterwards.
I've tried closing World Wide Web services, changing a lot of ports and surfing many forums, and eventually I looked in to Logs=>Apache (error.log) files.
I saw in this error:
PHP Fatal error: Directive 'asp_tags' is no longer available in PHP in Unknown on line 0
Then I opened php.ini files in XAMPP. Find with ctrl+f asp_tags=On line and turn it to Off.
All of it then worked.
In my case Apache 2.4 is worked on Win7Pro 64bit. Last week it worked fine but today I was unable to start it as usually. I tried to check logs for errors but no clue. Then I went to Control panel -> Administrative tools -> Services and found there Apache service was disabled!? Click on property, set Startup type to manual and - voila! It started like charm.

404 with VirtualHost and Subdirectories with Apache (httpd)

Note: apparently there's a collision on the ServerName in my virtualhost entries and I need to make some changes to my /etc/hosts files. Looking into this but any insight is appreciated. Thanks
=======================================
(note I replaced http:// with hxxp:// to allow stackoverflow to let me post this)
I have a server, 10.1.1.1 that I am going to host multiple WordPress installations on in subdirectories. Specs on the server:
OS: RHEL 6.2 Santiago
Apache version: Apache/2.2.15 (Unix)
PHP version: 5.3.9
MySQL version 5.5.20
The first WordPress Installation I want to run from the virtual directory site_one (i.e. hxxp://10.1.1.1/site_one) -- the code for this site is to reside in /var/www/sites/site_one
The second WordPress Installation I want to run from the virtual directory site_two (i.e. hxxp://10.1.1.1/site_two) -- the code for this site is to reside in /var/www/sites/site_two
I have also dropped a dummy hello world index.html file in /var/www/sites
--
I have made the following changes to my httpd.conf:
DocumentRoot for the entire site is set to /var/www/sites i.e.:
DocumentRoot "/var/www/sites"
at the very bottom of httpd.conf I have the following VirtualHost directives (I replaced < and > with [ ] because I couldn't get stack overflow to output < blocks >:
NameVirtualHost *:80
[VirtualHost *:80]
ServerName 10.1.1.1
DocumentRoot /var/www/sites/site_one
Alias /site_one /var/www/sites/site_one/
[/VirtualHost]
[VirtualHost *:80]
ServerName 10.1.1.1
DocumentRoot /var/www/sites/site_two
Alias /site_two /var/www/sites/site_two/
[/VirtualHost]
I check the syntax of httpd (httpd -t) and the sytax is OK
I restart httpd
--
If I try to access hxxp://10.1.1.1/site_two it gives me a 404 and the error_log reports that it is looking in /var/www/sites/sites_one/site_two/ for the file... Obviously I want it to not look there but in /var/www/sites/site_two/ ... what am I doing wrong? Thanks for any and all help!
See the Apache documentation. http://httpd.apache.org/docs/2.2/vhosts/name-based.html
You are trying to use Name Based Virtual Host because you only have one IP address. This is fine but you are missing the DNS part of how this works. From the documentation: "you need only configure your DNS server to map each hostname to the correct IP address and then configure the Apache HTTP Server to recognize the different hostnames."
The first listed virtual host is always the default host. That is why your site_one will behave the way you "think" it is supposed to, however when you try to access site_two, it falls under the default virtual host.
You have the wrong idea about how Virtual Hosts work. What you are trying to do can be accomplished using aliases, however if anywhere in your code you refer to document root, you have to follow it up with which site you are referring to.
E.g. in PHP code something like this:
require($_SERVER['DOCUMENT_ROOT']."/site_one/directory/to/wherever

MAMP just ONE virtual host not working

I wanted to start a (my first) wordpress project on my mac.
I run apache with MAMP, and wanted to make another (I allready have a few) virtual host for this particular project.
I added the host to my httpd.conf and etc/hosts file as i've done many times before.
When I browse to the url i've chosen I just end up in the directory that i've specified as root folder in my MAMP settings.
Apache seems to ignore the changes made in the httpd.conf file, but if I remove (rename) the httpd.conf file (to _httpd.conf) it apache doesn't start. so it looks like changes to this file are ignored, BUT if I put something wrong in the file apache doesn't start either...
this is what I put in the httpd.conf file to add a virtual host:
<VirtualHost *>
DocumentRoot "/Users/username/Sites/site_dir/"
ServerName local.sitename.com
<Directory "/Users/username/Sites/site_dir/">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
can this have anything to do with WP?
greets,
R.
On Windows:
Try putting it in the conf/extras/httpd-vhosts.conf instead and try
where port 80 is whatever port you have apache running on (:80 by default on windows)
and try not to use .org .com or any ending common on the web in your server name/alias use if you are developing the project on your localhost use something like sitename.local instead.
On Mac:
Not sure how it would work
On Ubuntu 11.04:
I just:
Set up a different vhost file for each site inside of /etc/apache2/sites-available
Then enable the site via a2ensite or just make a copy to the file using cp to the sites-enabled folder (all this is done via the ssh or a terminal on mac)
I then reload and restart apache and wallah!
I'm having a similar problem on one of my ubuntu servers. I'm doing something that I've done several times but all of a sudden it doesn't work. Go figure, lol! Typo? Who knows, definitely scour the web, an answer is sure to surface.