Migrate web application from xmapp to lamp - linux

I have developed web application using codeigniter on xampp server.
and want to deploy it on LAMP server. I have migrated database and app successfully but facing some problem.
When request web page using browser its not show anything not even error.
I have enabled selinux,
have root account and testing using root account
virtual host file config in /etc/httpd/conf.modules.d/hotelking.conf
<VirtualHost *:80>
ServerName www.hotelking.com
ServerAlias hotelking.com
DocumentRoot /var/www/hotelking/app/
Customlog "logs/www.hotelking.com.log" combined
ErrorLog "log/www.hotelking.com.error_log"
<Directory /var/www/hotelking/app/>
Require all granted
</Directory>
And error log have following error
[Wed Jan 06 03:20:14.515526 2016] [:error] [pid 6912] [client 127.0.0.1:40964] PHP Fatal error: Class 'MY_controller' not found in /var/www/hotelking/app/application/controllers/master.php on line 5
[Wed Jan 06 03:20:21.773841 2016] [:error] [pid 6908] [client 127.0.0.1:40965] PHP Fatal error: Class 'MY_controller' not found in /var/www/hotelking/app/application/controllers/master.php on line 5
I CHECKED IT HAS MY_controller at give location

Related

RewriteEngine not allowed here magento and apache2 on VPS

I've just installed Magento on my VPS (Debian 11), I must say Magento it's a pain compared to PretaShop and Wordpress, but I really need it.
After a painful installation, I run the page and I get the following:
Internal Server Error The server encountered an internal error or
misconfiguration and was unable to complete your request.
Please contact the server administrator at info#magento.mywebsite.ie to
inform them of the time this error occurred, and the actions you
performed just before this error.
More information about this error may be available in the server error
log.
Additionally, a 500 Internal Server Error error was encountered while
trying to use an ErrorDocument to handle the request.
Then I thought to check logs. So I opened the file magento.mywebsite.ie.error.log and there is a list of all the attempts, like the following:
[Sun Oct 23 17:04:41.916039 2022] [core:alert] [pid 886340:tid
139973219006208] [client 51.37.89.15:0]
/home/elliot/web/magento.mywebsite.ie/public_html/magento2/.htaccess:
RewriteEngine not allowed here [Sun Oct 23 17:04:42.225156 2022]
[core:alert] [pid 886340:tid 139973202220800] [client 51.37.89.15:0]
/home/elliot/web/magento.mywebsite.ie/public_html/magento2/.htaccess:
RewriteEngine not allowed here [Sun Oct 23 17:04:42.495916 2022]
[core:alert] [pid 886340:tid 139973185435392] [client 51.37.89.15:0]
/home/elliot/web/magento.mywebsite.ie/public_html/magento2/.htaccess:
RewriteEngine not allowed here [Sun Oct 23 17:04:42.705350 2022]
[core:alert] [pid 886340:tid 139973168649984] [client 51.37.89.15:0]
/home/elliot/web/magento.mywebsite.ie/public_html/magento2/.htaccess:
RewriteEngine not allowed here [Sun Oct 23 17:04:42.909888 2022]
[core:alert] [pid 886340:tid 139973311325952] [client 51.37.89.15:0]
/home/elliot/web/magento.mywebsite.ie/public_html/magento2/.htaccess:
RewriteEngine not allowed here [Sun Oct 23 17:05:22.958733 2022]
[core:alert] [pid 886660:tid 140355403986688] [client 51.37.89.15:0]
/home/elliot/web/magento.mywebsite.ie/public_html/magento2/.htaccess:
RewriteEngine not allowed here
The files .htaccess in my Magento new installation are exactly identical to the .htaccess that you would find here on GitHub:
Link: https://github.com/magento/magento2
You will find .htaccess in the parent folder magento2, another one in the Document Root "pub" inside magento2. My opinion is that the system is using the one in the parent directory, magento2, since if I delete that .htaccess, the webpage would show "This page isn’t working" instead of "Internal Server Error", so the error message would be different in this way.
And this is apache2.ssl.conf used as configuration file:
I removed the comments here
<VirtualHost 141.146.42.11:8443>
ServerName magento.mywebsite.ie
ServerAdmin info#magento.mywebsite.ie
DocumentRoot /home/elliot/web/magento.mywebsite.ie/public_html/magento2/pub
ScriptAlias /cgi-bin/ /home/elliot/web/magento.mywebsite.ie/cgi-bin/
Alias /vstats/ /home/elliot/web/magento.mywebsite.ie/stats/
Alias /error/ /home/elliot/web/magento.mywebsite.ie/document_errors/
#SuexecUserGroup elliot elliot
CustomLog /var/log/apache2/domains/magento.mywebsite.ie.bytes bytes
CustomLog /var/log/apache2/domains/magento.mywebsite.ie.log combined
ErrorLog /var/log/apache2/domains/magento.mywebsite.ie.error.log
<Directory /home/elliot/web/magento.mywebsite.ie/stats>
AllowOverride All
</Directory>
<Directory /home/elliot/web/magento.mywebsite.ie/public_html/magento2/pub>
AllowOverride All
SSLRequireSSL
Options +Includes -Indexes +ExecCGI </Directory>
SSLEngine on
SSLVerifyClient none
SSLCertificateFile /home/elliot/conf/web/magento.mywebsite.ie/ssl/magento.mywebsite.ie.crt
SSLCertificateKeyFile /home/elliot/conf/web/magento.mywebsite.ie/ssl/magento.mywebsite.ie.key
SSLCertificateChainFile /home/elliot/conf/web/magento.mywebsite.ie/ssl/magento.mywebsite.ie.ca
<FilesMatch \.php$>
SetHandler "proxy:unix:/run/php/php8.1-fpm-magento.mywebsite.ie.sock|fcgi://localhost"
</FilesMatch>
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
IncludeOptional /home/elliot/conf/web/magento.mywebsite.ie/apache2.ssl.conf_*
IncludeOptional /etc/apache2/conf.d/*.inc
</VirtualHost>
Please could you be so kind to help me with this? I have no experience at all about Apache issues, then I didn't know what else info I could provide to you. Hope you can help.
I solved the problem by adding the following line with the Parent Root Directory to my apache2.ssl.conf:
<Directory /home/elliot/web/magento.mywebsite.ie/public_html/magento2>
AllowOverride All
</Directory>
In this way also the parent directory has AllowOverride All.

Intermittent Service not available Error in Elasticbeanstalk application

We are using a webserver with ElasticBeanstalk from 2019.,
the platform is
tomcat 8.5 with java8 running on 64 bit Amazon Linux. httpd as proxy
recently (from Jan 30th) we started getting Service Unavailable issues if go to the endpoint from time to time. and if we refresh 2-3 times it will get resolved on its own.
then I download full logs. under elasticbeanstalk-error_log I can see
[Mon Feb 28 10:00:58.338035 2022] [proxy:error] [pid 14882:tid 139757313533696] (13)Permission denied: AH02454: HTTP: attempt to connect to Unix domain socket /var/run/httpd/ (localhost) failed
[Mon Feb 28 10:00:58.338078 2022] [proxy_http:error] [pid 14882:tid 139757313533696] [client <private-ip-here>:12566] AH01114: HTTP: failed to make connection to backend: httpd-UDS, referer: http://<custom-end-point>/1/<name.jsp>?s=sec$$4P!&refresh=300
[Mon Feb 28 10:43:40.663468 2022] [proxy:error] [pid 14882:tid 139757120071424] (13)Permission denied: AH02454: HTTP: attempt to connect to Unix domain socket /var/run/httpd/ (localhost) failed
[Mon Feb 28 10:43:40.663518 2022] [proxy_http:error] [pid 14882:tid 139757120071424] [client <private-ip-here>:21136] AH01114: HTTP: failed to make connection to backend: httpd-UDS
repeated multiple times from Jan30th.
and when I look at access.log
I can see 503 error log exactly at the same time when permission denied error logs in elasticbeanstalk-error_log
And I looked at the running process using ps -aux | grep HTTPd and ps -aux | grep tomcat
both are running from 2019 and have no restarts.
what more I can do to troubleshoot these issuesWe are running a web application written in Java(tomcat8) hosted in AWS ElastcBeanStalk
Some weeks back we started getting 503 error randomly
When we checked the elasticbeanstalk-erorr_logs
[Thu Mar 03 13:22:12.906144 2022] [proxy:error] [pid 14882:tid 139757338711808] (13)Permission denied: AH02454: HTTP: attempt to connect to Unix domain socket /var/run/httpd/ (localhost) failed
[Thu Mar 03 13:22:12.906202 2022] [proxy_http:error] [pid 14882:tid 139757338711808] [client 172.31.17.0:61382] AH01114: HTTP: failed to make connection to backend: httpd-UDS, referer: http://our-domain.com/1/callBackLog.jsp
The error logs are suggesting connection error with backend unix socket
When we checked in /var/run/httpd/ folder, there were no unix sockets(.sock files)
But in apache httpd config
<VirtualHost *:80>
<Proxy *>
Require all granted
ProxyPass / http://localhost:8080/ retry=0
ProxyPassReverse / http://localhost:8080/
ProxyPreserveHost on
ErrorLog /var/log/httpd/elasticbeanstalk-error_log
the proxy backend is ip address not unix socket
As per the config httpd should connect to backend ip address(localhost:8080) but why is it complaining about unix socket
Have anyone faced similar issues?
============= UPDATE
The error logs are suggesting connection error with backend unix socket
When we checked in /var/run/httpd/ folder, there were no unix sockets(.sock files)
But in apache httpd config
<VirtualHost *:80>
<Proxy *>
Require all granted
ProxyPass / http://localhost:8080/ retry=0
ProxyPassReverse / http://localhost:8080/
ProxyPreserveHost on
ErrorLog /var/log/httpd/elasticbeanstalk-error_log
the proxy backend is ip address not unix socket
As per the config httpd should connect to backend ip address(localhost:8080) but why is it complaining about unix socket
Have anyone faced similar issues?

How to fix: Truncated or oversized response headers received from daemon process

I have a flask application that runs on an apache web server, and recently i added a feature using the p4python module. But every time the site calls this package, i get a 500 Internal Server Error. When i check the error log i get the error saying "Truncated or oversized response headers received from daemon process ".
Configuration
Ubuntu 14.04.6
Apache 2.4.7
Python 3.4.3
mod-wsgi 4.6.8
openssl 1.0.1f
Notable python packages are
Flask 1.0.4
psycopg2 2.8.3
p4python 2019.1.1858212
I have tried every solution suggested on the other threads here, and i have tried the debugging suggestions from https://modwsgi.readthedocs.io/en/develop/user-guides/debugging-techniques.html#tracking-request-and-response.
This includes setting WSGIApplicationGroup %{GLOBAL}, increasing the header size and updating mod-wsgi to the newest version using pip.
Unfortunately none of this has worked, and when i call a function using the p4python api the site shows an error.
.conf file
Listen 31415
<VirtualHost *:31415>
ServerName dev-collab
SSLEngine on
SSLCertificateFile /etc/ssl/private/********.cer
SSLCertificateKeyFile /etc/ssl/private/*********.key
WSGIDaemonProcess applicationDash user=www-data group=www-data threads=6 python-home=/var/www/applicationDash/venv
WSGIScriptAlias / /var/www/applicationDash/api.wsgi
ErrorLog "/var/log/apache2/applicationDash_error.log"
CustomLog "/var/log/apache2/applicationDash_access.log" common
LogLevel info
DocumentRoot "/var/www/applicationDash"
<Directory "/var/www/applicationDash">
WSGIProcessGroup applicationDash
WSGIScriptReloading On
WSGIApplicationGroup %{GLOBAL}
</Directory>
Alias /static /var/www/applicationDash/static
<Directory "/var/www/applicationDash/static">
Require all granted
</Directory>
</VirtualHost>
Response header
[wsgi:error] [pid 42349] [remote 10.4.24.191:52037] ('RESPONSE',
[wsgi:error] [pid 42349] [remote 10.4.24.191:52037] '200 OK',
[wsgi:error] [pid 42349] [remote 10.4.24.191:52037] [('Content-Type', 'text/html; charset=utf-8'), ('Content-Length', '5598')])
The actual error
[wsgi:info] [pid 42371] mod_wsgi (pid=42371): Attach interpreter ''.
[wsgi:info] [pid 42371] mod_wsgi (pid=42371): Imported 'mod_wsgi'.
[ssl:info] [pid 41529] [client 10.4.32.52:53304] AH01964: Connection to child 2 established (server dev-collab:443)
[ssl:info] [pid 41529] (70014)End of file found: [client 10.4.32.52:53304] AH01991: SSL input filter read failed.
[ssl:info] [pid 41530] [client 10.4.24.191:58651] AH01964: Connection to child 3 established (server dev-collab:443)
[wsgi:info] [pid 42371] [remote 10.4.24.191:58651] mod_wsgi (pid=42371, process='applicationDash', application=''): Loading Python script file '/var/www/applicationDash/api.wsgi'.
[wsgi:error] [pid 41530] [client 10.4.24.191:58651] Truncated or oversized response headers received from daemon process 'applicationDash': /var/www/applicationDash/api.wsgi, referer: https://dev-collab:31415/branch/3/AccessControl
This is all with LogLevel info.
Does anyone have an idea where my mistake lies?

Apache mod_wl2.4 plugin error parseJVMID

I have some issues with setting an clustered environment for weblogic and Apache. The structure is like this: 1 webserver that proxies requests to a clustered environment of 3 weblogic servers.
Everytime i send the request to the apache server , the request gets unhandled. I figured out a part of the problem , but that is something that is not intended in production. whenever i add DynamicServerList On the requests fail. When i switch it to off it works, but that means whenever a server fails , apache will still send requests to that server and user experience would be 0.
EDIT 1: I am using weblogic 12c and apache2.4 for Centos 7
EDIT 2: There is no firewall nor selinux active
Here is my config file for weblogic plugin:
<VirtualHost *:8080>
ServerAdmin postmaster#webserver2
ServerName webserver2
DocumentRoot /var/www/webserver2/htdocs
ErrorLog /var/log/httpd//webserver-error_log
CustomLog /var/log/httpd/webserver-access_log forwarded
<Directory />
AllowOverride all
Order allow,deny
Allow from all
</Directory>
DirectoryIndex index.html
<Location />
SetHandler weblogic-handler
</Location>
<IfModule mod_weblogic.c>
WeblogicCluster 192.168.166.70:8001,192.168.166.71:8001,192.168.166.69:8001
ConnectTimeoutSecs 15
ConnectRetrySecs 10
WLIOTimeoutSecs 600
DynamicServerList ON
Idempotent ON
FileCaching ON
KeepAliveSecs 60
KeepAliveEnabled ON
DebugConfigInfo ON
</IfModule>
</VirtualHost>
And the errors I get are the following:
[Mon Sep 14 09:54:58.480616 2015] [weblogic:error] [pid 15343:tid
140547949991680] [client 172.18.132.50:57991] <1534314422136982>
parseJVMID: could not resolve hostname '-1062689209'. Returning NULL
from parseJVMID
[Mon Sep 14 09:54:58.480681 2015] [weblogic:error]
[pid 15343:tid 140547949991680] [client 172.18.132.50:57991]
<1534314422136982> initJVMID: parseClusterServerList failure
[Mon Sep
14 09:55:28.481215 2015] [weblogic:error] [pid 15343:tid
140547949991680] [client 172.18.132.50:57991] <1534314422136982>
request [/clusterjsp/HaJsp.jsp] did NOT process
successfully..................

Configure Apache web server to perform SSL authentication

I'm trying to perform SSL authentication in apache web server, using XAMPP in Linux. After I configure httpd.conf like this, Apache server is failing to start. Can some one help me to fix this ? What is wrong with my configuration ?
Alias /bitnami/ "/opt/lampp/apache2/htdocs/"
Alias /bitnami "/opt/lampp/apache2/htdocs"
<Directory "/opt/lampp/apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Listen 443
<VirtualHost 127.0.0.1:443>
DocumentRoot "/opt/lampp/htdocs"
ServerName localhost.localdomain
SSLEngine on
SSLCertificateFile "/home/lahiru/Desktop/ucsc/security/ssl/server.cer"
SSLCertificateKeyFile "/home/lahiru/Desktop/ucsc/security/ssl/server.key"
SSLVerifyClient require
SSLVerifyDepth 10
SSLCACertificateFile "/home/lahiru/Desktop/ucsc/security/ssl/ca.cer"
</VirtualHost>
And the Apache error log says,
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:443
[Sun Jun 21 07:42:47.000754 2015] [ssl:warn] [pid 1863] AH01909: localhost.localdomain:443:0 server certificate does NOT include an ID which matches the server name
[Sun Jun 21 07:42:47.001082 2015] [ssl:warn] [pid 1863] AH01906: www.example.com:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Sun Jun 21 07:42:47.001101 2015] [ssl:warn] [pid 1863] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Jun 21 07:42:47.001183 2015] [suexec:notice] [pid 1863] AH01232: suEXEC mechanism enabled (wrapper: /opt/lampp/bin/suexec)
Bitnami developer here,
In XAMPP the SSL configuration is located at /opt/lampp/etc/extras/httpd-ssl.conf file, where there is a default VirtualHost already configured in port 443, and you are trying to bind again the same port.
Please, try to modify this file instead. You can check if there is any other process using port 443 running command sudo netstat -vnpa | grep 443
What do you mean with "Apache server is failing to start"? Using the /opt/lampp/ctlscript.sh script to restart Apache server didn't produce any error message on my side but the error_log told me the same that you mentioned.
Regards,
Gonzalo

Resources