Just trying to install Apache on Mac (Catalina) following this tutorial. Once installed, I receive an error as ServerRoot directory is not correct when trying to run Apache.
Even changing this directory to the correct one, I continue having the same problem:
httpd: Syntax error on line 31 of /usr/local/etc/httpd/httpd.conf:
ServerRoot must be a valid directory
Any advice?
Related
I installed xampp and its been working fine, until I started getting the following error whenever I tried to start xampp:
XAMPP is currently only availably as 32 bit application. Please use a 32 bit compatibility librar
y for your system.
After commenting the lines of code in /opt/lampp/lampp that referenced this error I now get a new error when launching xampp with /opt/lampp/lampp start:
Starting XAMPP for Linux 7.2.3-0...
XAMPP: Starting Apache...fail.
httpd: Syntax error on line 522 of /opt/lampp/etc/httpd.conf: Syntax error on line 10 of /opt/lam
pp/etc/extra/httpd-xampp.conf: Cannot load modules/libphp7.so into server: libnsl.so.1: cannot op
en shared object file: No such file or directory
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.
I have php-7.2.3 installed in /opt/lampp/bin and apache and everything else was working before. How do I get Apache to launch?
it seems you're missing the libnsl, install it through this command:
# sudo dnf install libnsl
In case this doesn't work you can then download it manually:
visit https://pkgs.org/
in the search box (pkgs.org of course) type libnsl.so.1 and choose the appropriate OS. The version shown might be higher e.g libnsl-2.28-9.fc29.x86_64.rpm, but it doesn't matter, the file needed is also included in this very package.
in the terminal, navigate to the directory where the .rpm was downloaded.
then type the following command to install it:
# sudo rpm libnsl-2.XX-X.fc29.x86_64.rpm
Upon completion everything should be working fine.
Trying to enable the mod_ssl module on Apache 2.4.25, I get the following error:
httpd: Syntax error on line 129 of /ld01/otsweb/build/apache/httpd24.conf: Cannot load modules/mod_ssl.so into server: \t0509-022 Cannot load module /usr/local/apache24/modules/mod_ssl.so.\n\t0509-150 Dependent module libssl.so could not be loaded.\n\t0509-022 Cannot load module libssl.so.\n\t0509-026 System error: A file or directory in the path name does not exist.\n\t0509-022 Cannot load module /usr/local/apache24/modules/mod_ssl.so.\n\t0509-150 Dependent module /usr/local/apache24/modules/mod_ssl.so could not be loaded.
Line 129 is the LoadModule ssl_module modules/mod_ssl.so line in the httpd.conf file.
I have the same configuration running correctly on another server. That server does not have a libssl.so file on it, yet Apache with SSL is running.
Apache was configured with: (OpenSSL version is 1.0.2k from openssl.org)
./configure --enable-mods-shared="proxy proxy_http" --enable-auth-digest --enable-ssl --with-ssl=/usr/local/ssl/bin
Has anyone seen this same error?
With the release of OpenSSL 1.0.2l we decided to reinstall Apache from scratch, and everything is working correctly. A clean install of both seems to have cleared out the problem.
I've just installed the latest version of WAMP on my dev machine, and I can't get it to work. Getting this weird error.
C:\wamp\bin\apache\Apache2.4.4\bin>httpd.exe
AH00526: Syntax error on line 224 of C:/wamp/bin/apache/Apache2.4.4/conf/httpd.conf:
Invalid command 'Require', perhaps misspelled or defined by a module not included in the server configuration
C:\wamp\bin\apache\Apache2.4.4\bin>httpd.exe -v
Server version: Apache/2.4.4 (Win64)
Server built: Feb 22 2013 22:08:37
This is the config at line 224:
222: <Directory />
223: AllowOverride none
224: Require all granted
225: </Directory>
Any idea what I'm doing wrong?
The Require directive is supplied by mod_authz_core. If the module has not been compiled into your Apache binary, you will need to add an entry to your configuration file to load it manually. You can check which modules are compiled in with httpd.exe -l.
If the module is not compiled in, load it with a configuration line similar to the following:
LoadModule authz_core_module "<apache install dir>/modules/standard/mod_authz_core.so"
You will need to adjust the path for your system of course, and on a Windows box the library may well be a dll rather than an so file.
I had installed mod_tile and apache2 and tile server worked without problem. after that i installed php5.5.3. it changed all file structures of apache2 conf. i think something has changed. "LoadModule tile_module"had been removed from the config file. I added it in new apache2.conf file. but now when i restart apache it shows this message:
apache2: Syntax error on line 141 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/mod_tile.conf: Cannot load /usr/lib/apache2/modules/mod_tile.so into server: /usr/lib/apache2/modules/mod_tile.so: undefined symbol: unixd_set_global_mutex_perms
Action 'configtest' failed.
and this is /etc/apache2/mods-enabled/mod_tile.conf
LoadModule tile_module /usr/lib/apache2/modules/mod_tile.so
The actual directory of the apache2.conf is /etc/apache/apache.conf. And there is sites-enabled directory. I changed the directory path of the sites-enabled directory to /var/www/sites-enabled. Further went on to change the directory pat of the sites-enabled in the apacche2.conf as ../../var/www/sites-enabled/
It throws the error
apache2: Syntax error on line 230 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/var/www/sites-enabled/: No such file or directory
Action 'configtest' failed.
Any ideas on how I could resolve this?
Put in the correct path now it throws this error
apache2: Syntax error on line 230 of /etc/apache2/apache2.conf: Could not open configuration file /var/www/sites-enabled/000-default: No such file or directory
Action 'configtest' failed.
Thanks
Jean
You might have built the dangling a while ago. You should remove the association by
d2dissite 000-default
Then add your website alias with
a2ensite yoursite.com
I met similar errors before. It occurred when I was installing new modules but configured it wrongly. My solution was to locate the error configuration and remove the configure file.
If the error was caused by modules related configuration, you can try:
/etc/init.d/apache2 -M
This generated error message for me
apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/mods-enabled/ example.load: No such file or directory
I checked that directory, and found there is an example.load file, I deleted it and restart the server, and the problem solved.
Generally, I think you should try:
locate which was the origin of the error.
systemctl status apach2.status
If it is originated by wrong module configurations, locate which configuration file was the origin of the error.
/etc/init.d/apache2 restart
In your case, it may be caused by your wrong configuration on the site, you can check the configuration and modify it correctly.
It was due to permission error
sudo apache2 restart