Apache Web Server

20K

Solutions

15K

Contributors

The Apache HTTP Server is a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards. Typically Apache is run on a Unix-like operating system, but it is available for a wide variety of operating systems, including Linux, Novell NetWare, Mac OS-X and Windows. Released under the Apache License, Apache is open-source software.

Share tech news, updates, or what's on your mind.

Sign up to Post

What command can i run from mac terminal to know the version of Apache that’s running on a remote web server using IP address
0
Exploring SharePoint 2016
LVL 19
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

I have Xampp installed in Windows2012R2.
I have this error after a reboot in Xampp. I have opencart installed.  
If I change the port from 80 to 81 or other port apache starts. Any idea what could be wrong?
It seems port is used somewhere not sure where?
Capture53.JPG
0
Is it possible to set up a script on an Apache web server to email me whenever a 500 error happens? How would I do that? We use Symfony and if there's a code failure I want to know about it bright away... the Symfony logs don't show a 500 error but the server logs do.
0
Hello Experts,
I have built few HTTP 1.1 listen service mocks using SoapUI and CA DevTest tools. Every request to the service from a client like Postman is established as a new connection. Inserting a custom header Connection:Keep-Alive into the request and also the response is not making any difference. Can I know is there more to be done to have the socket open for successive connections happening within a second?

Thanks.
0
Hi everybody.
So I have several website. Their structure is:

-admin
-css
-en
  -index.php
-es
  -index.php
-js
.htaccess
index.php
urlrewriter.php

The index.php in the root just redirect to the index in es folder, where are spanish version of the website:

index.php in root
<?php
header("Location: /es/index.php");

Open in new window


I use url rewriter to rewrite urls accordingly to a configuration file. The important thing is that in all websites I have the same code for all these files (what's change is the html template and okay some other things but none of them is related to this question).

In .htaccess  I have this
<IfModule mod_rewrite.c>
RewriteEngine on
Options +SymLinksIfOwnerMatch
RewriteBase /

RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$
RewriteRule .* https://www.%1%{REQUEST_URI} [L,NE,R=301]

RewriteCond $1 !^(admin/|witpack/php|auth|.css|.js|.jpg|.png|.gif)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . /urlrewriter.php [L]
</IfModule>

Open in new window


in urlrewriter.php I have this code:
<?php
require_once __DIR__ . '/inc_common.php';
$url = strtok($_SERVER['REQUEST_URI'], '?');
$requestedPage = substr($url, 1, strlen($url) - 1);
$safePages = array();
foreach ($config->translation->pages as $langGroup) {
    foreach ($langGroup as $key => $value) {
        array_push($safePages, $value);
    }
}
if (!empty($requestedPage)) {
    if (!in_array(trim($requestedPage), $safePages)) {
        echo "requestedPage: $requestedPage<br>";
        echo "<pre>";
        var_dump($safePages);
        echo "</pre>";
//        header("Location: /403.php");
    } else {
        include($_SERVER['DOCUMENT_ROOT'] . "/$requestedPage.php");
    }
}

Open in new window


So when someone just types the domain name www.website.com, it is redirected to urlrewriter.php. Here the requested page result to be es/index.php. Since this page is in $safePages, it is just included.

Suddenly, in the new website I'm building this proven code stopped to work! Typing the url of the website, the es/index.php page is served but without all php variables initialized in the inc_common.php file included in urlrewriter.php. If I comment the redirection in the root index.php, I just get a blank page. If I play with the .htaccess, the only result I've got is an infinite loop or the list of pages due to the var_dump in urlrewriter.php because the requested url result to be urlrewriter.php itself.
I've got this last result when I I changed htaccess this way:

Open in new window

0
Pls help...

User http access : sdm.mnd.com (75.68.129.206, Port 80)
Gateway will NAT the IP address & port to reserve Proxy server IP : 152.210.72.4:10118
RH Linux - Reserse proxy server : 152.210.72.4:10118
RH Linux application server : 152.160.85.4:10021

Verified the application server works well with direct IP.
RH Linux reverse proxy server, verified httpd successfully started.
Configuring reverse proxy settings, it is not working.
Can help me/ advise me what went wrong or to be modified...

User will access the URL http://sdm.mnd.com

Reverse proxy server httpd.conf file

<VirtualHost *:10118>
        ServerAdmin admin@mnd.com
        ProxyRequests off
        ProxyPreserveHost On
        ServerName sdm.mnd.com
        ProxyPass               /        http://152.160.85.4:10021
        ProxyPassReverse        /        http://152.160.85.4:10021
</VirtualHost>


Application server server.xml file

-->
      <Connector port="10021" protocol="HTTP/1.1"
      connectionTimeout="20000"

      redirectPort="8443" URIEncoding="UTF-8" />
   
      <!-- A "Connector" using the shared thread pool-->
   
<!--
0
Hi,

need help...
i am having two servers,  web reverse proxy and tomcat application server.

1. tomcat Application server is 120.121.25.16 default port number changed in server.xml file, port number is 28056. I checked the tomcat application server, it works after port change and verified application.

2. RH7.7 reverse proxy server 10.38.11.26
i installed httpd.
/etc/httpd/conf/httpd.conf edited and changed the default port 80 to 29081 in listener.
restartng the httpd, it is failing

After port change the httpd service not coming up...

Error below...
Oct 18 23:04:34 webpxy1httpd[19252]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 10.250.245.6. Set the 'ServerNa
Oct 18 23:04:34 webpxy1 httpd[19252]: (13)Permission denied: AH00072: make_sock: could not bind to address [::]:8011
Oct 18 23:04:34 webpxy1 httpd[19252]: (13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:8011
Oct 18 23:04:34 webpxy1 httpd[19252]: no listening sockets available, shutting down
Oct 18 23:04:34 webpxy1 httpd[19252]: no listening sockets available, shutting down
Oct 18 23:04:34 webpxy1 httpd[19252]: AH00015: Unable to open logs
Oct 18 23:04:34 webpxy1 systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Oct 18 23:04:34 webpxy1 kill[19253]: kill: cannot find process ""
Oct 18 23:04:34 webpxy1 systemd[1]: httpd.service: control process exited, code=exited status=1
Oct 18 23:04:34 …
0
Hello,
which is better for apache using php-mod or php-fpm ?
thanks.
0
just built a vm running fedora 30.  downloaded and compiled apache 2.4.41 but only partially working.  i have ssl configured but https doesn't work.  the log file shows mod_ssl/openssl present, initializing servers for ssl, configuring tls extension handling, shows the certificate and private key, conf file has it listening on 443 but using netstat only shows http.  no errors int he log, selinux is disabled.  can't figure out why this piece isn't working
0
Apache server suddenly stopped.  Although we tried to reboot, it stuck. To find the root cause, which logs we should check?

[root@servername ~]# systemctl status httpd
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: man:httpd(8)
           man:apachectl(8)
[root@servername ~]# systemctl stop httpd
[root@servername ~]# systemctl start httpd
its stuck

It's appreciate your advices.
0
Fundamentals of JavaScript
LVL 19
Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

hi guys

I have an EC2 AWS instance running apache. We previously bought SSL certificates and had them installed. They have now expired. We renewed them with Godaddy.

I want to install them on the server, but I can't seem to find the location where they need to go. One of our techies who has left may have played with the http.conf file but I am unable to work this out.

Can someone give advice on how to work on this?

Thank you
Yash
0
We are getting a CORS error when trying to run and API request from one of our subdomains to another. I saw an htaccess fix...

<ifmodule mod_headers.c="">
   SetEnvIf Origin "^(.*\.MyDomain\.com)$" ORIGIN_SUB_DOMAIN=$1
   Header set Access-Control-Allow-Origin "%{ORIGIN_SUB_DOMAIN}e" env=ORIGIN_SUB_DOMAIN
   Header set Access-Control-Allow-Methods: "*"
   Header set Access-Control-Allow-Headers: "Origin, X-Requested-With, Content-Type, Accept, Authorization"
</ifmodule>

I added that to the htaccess file of where the API request was going *to*, but we still get the error. Does it need to go in the htaccess of the site the request is coming *from*? Or both? In other words, does the htaccess stuff need to live where the request originates or where the request is processed? Or both?
0
Hi,

I have added the line $wgExternalLinkTarget = '_blank' to LocalSettings.php so that external links open in a new windows and this works fine.  I also want to open internal links, e.g. PDF links in the same way.  Is there an easy solution to this, similar to external links?
0
i have a centos 7 and installing httpd on it.
i open firewall for port 80 and start httpd services. service is running ok.

in my etc/hosts ihave
127.0.0.1 localhost localhost.localdomain
..
..
10.10.1.10  localhost

in my httpd.conf  ihave
ServerName 10.10.1.10

browse 10.10.1.10 says :  Not possible to connect to website 10.10.0.10

what is wrong here?
0
Hello EE,

I am new Apache SVN , I have recently installed apache SVN using https://www.itzgeek.com/how-tos/linux/centos-how-tos/install-apache-svn-subversion-on-centos-7-rhel-7.html . I have created a new repository called "subversion " and wish to import a copy of an existing repository on another centos server into this new  svn instance . Can you please provide the proper direction on this matter .

CentOS Linux 7 (Core) , Apache /2.4.6 ( Red Hat Enterprise Linux)
0
The web application in my organizations uses Apache web server that load balance across Application servers (Tomcat instance). There are two Apache (Web server) instances that route the traffic to 4 Application server instance.

The HTTPS traffic coming to the application terminates at the Web server layer, and then communication between Web server and App server is over HTTP. My assumption is that Web server and App-server communicates over HTTP and not over HTTPS.

However lately in a discussion with my IS team I came to know that Web server communication to App server over HTTP is not considered secure, and Web server should instead communicate to App server over HTTPS.

I would like to know your views on how generally this works in your organization?
0
Very strange problem
I have been using xampp in windows 10 for many months - no problems at all
In the last couple of days I have the problem where I try to log into phpmyadmin or any other site on my local webserver which requires a login, chrome browser just hangs
All the sites work in Firefox - no issues

I cannot see where the problem is in Chrome - I know I can recreate the Google chrome Data file and create a new one but I would rather not have to do that as I lose my settings
If I access the site from another pc with Chrome, the sites work just fine

Any ideas
0
Hi,

My company site is currently hosted on windows IIS web server  called  bob.com (for example). I have setup a separate test site that is on a ubuntu apache server hosted on a different cloud provider.
I want to edit the virtual host configuration on my test site (apache) to be a subdomain of my production website. So on the test site it will be test.bob.com. Is it enough/correct way to change the ServerName to bob.com and the ServerAlias to test.bob.com ? The reason I want to edit the virtualhost config is in order that I can put an ssl cert on test.bob.com
Are there any security concerns/ will there be any connection issues?

Thank you.
0
0
Microsoft Azure 2017
LVL 19
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.

Hi All,

I have a Moodle on-prem installation using Apache 2.4 on a Windows 2016 server. The systems works well however i want to secure it with an SSL now as external people will be accessing the site.

I used an online CSR generator and purchased a cert from GoDaddy.  I followed instructions from here https://www.digicert.com/csr-ssl-installation/apache-openssl.htm but it doesn't work.

I've seen so many articles but they mostly refer to linux servers.

Anyone care to assist?

Thanks
0
Recently I had a WordPress site for a friend. He never installed it, and someone installed it and uploaded a file that gave them access to my server.

The server wasn't really important, hence me being sort of lax with the security, but it got me thinking about how I could better secure WordPress installations on personal servers.

I was thinking I could either move the uploads directory outside of the web root. Or I could maybe configure Apache or some settings to where PHP files won't run.

I'm not going to post this on Stack Overflow because it's sort of discussion based. So any help would be appreciated.
0
I have a problem with the url rewriting in my .htaccess.
I use following lines to remove php extension:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^ %{REQUEST_URI}.php [L]

Open in new window


Originally my pages where in the document root and the following lines worked great to rewrite urls
RewriteCond %{THE_REQUEST} \s/categoria\?c=(\w+)\s [NC]
RewriteRule ^ /categoria/%1? [R=302,L]

Open in new window

But now I have put my pages in different subfolders accordingly to the chosen language. The main language is spanish and I have a folder 'es' where the spanish pages are. So I changed, or better I tried to change my htaccess to use subfolders:
RewriteCond %{THE_REQUEST} \s/es/categoria\?c=(\w+)\s [NC]
RewriteRule ^ es/categoria/%1? [R=302,L]

Open in new window

This works, because the url is actually rewritten, but it also generates an Internal Server Error. After some investigation I realized that it looks like there are too many redirections and once the limit is reached, Apache raises the error 500. But the suggeted solution to put an exclamation mark to the RewriteCond for files:
RewriteCond %{REQUEST_FILENAME}.php !-f

Open in new window

prevents the removing of the php extension.
Any idea?
Thank you.
0
How to configure Apache server such that access to the public ip of the server will automatically redirect me to the ./web/index.php

vhost.conf
<VirtualHost *:80>
    ServerAdmin mis@abc.com
    ServerName abc.com
    ServerAlias www.abc.com
    DocumentRoot /var/www/html/mec/
    ##ErrorLog /var/www/html/example.com/logs/error.log
    ##CustomLog /var/www/html/example.com/logs/access.log combined
</VirtualHost>

Thx
0
Hi everybody.
In a website I use .htaccess to write SEO friendly url and in the root directory everything works fine.

.htaccess
#first I drop the file extension
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{REQUEST_URI} ^(.+)\.php$
RewriteRule (.*)\.php$ /$1 [R=301,L]
#RewriteRule ^(.*)$ $1.php [QSA]

# then redirect "/vinos.php?id=xxx" to "/vinos/xxx"
RewriteCond %{THE_REQUEST} \s/vinos\.php\?v=(\w+)\s [NC]
RewriteRule ^ /vinos/%1? [R=301,L]

# internally rewrite "/vinos/xxx" to "/vinos.php?id=xxx"
RewriteRule ^vinos/(\w+)$ /vinos.php?v=$1 [L]

Open in new window


This way, the url mywebsite.com/vinos.php?v=sangre_de_toro becomes mywebsite.com/vinos/sangre_de_toro.
So in the vinos.php I have:
$url = explode("/", ($_SERVER["REQUEST_URI"]));
$vino_querido = end($url);

Open in new window

and then I use the variable $vino_querido in my sql query.

But I have added the support for two other language replicating the website pages in two subfolders 'en' and 'it' (the main langage 'es' is in the root). But in these subfolders the rewriting doesn't work.
The pages have different names, so I have added additional rules to my .htaccess:
RewriteCond %{THE_REQUEST} \s/it/vini\.php\?v=(\w+)\s [NC]
RewriteRule ^ /it/vini/%1? [R=301,L]

RewriteRule ^it/vini/(\w+)$ /it/vini.php?v=$1 [L]

RewriteCond %{THE_REQUEST} \s/en/wines\.php\?v=(\w+)\s [NC]
RewriteRule ^ /en/wines/%1? [R=301,L]

RewriteRule ^en/wines/(\w+)$ /en/wines.php?v=$1 [L]

Open in new window

But this has no effect, the url is not rewritten and the last element of the array $url in the wines.php (and vini.php) is "wines?v=blanco_afrutado" (or "vini?v=blanco_afrutado")
0
Originally I thought this would be a Wordpress question but now I want to approach this from a different perspective.

I am running a LAMP Stack in AWS using Amazon Linux. I have a company website that is a Wordpress site.

I have six domains that I want to (1) force from HTTP to HTTPS and (2) forward to "https://CompanysSite.com".

The other domains are variants, so, for example I want "http://CompanySite-inc.com" to forward to "https://CompanySite.com". And it's totally okay to have the domain name be changed to "https://CompanysSite.com" from whatever domain it came in on.

Is there a way to do this globally at the Apache level, perhaps using Mod-ReWrite? I just don't know enough about Apache to add that to the script in order to have all traffic sent to "https://CompanySite.com".

Thanks for your help!
0

Apache Web Server

20K

Solutions

15K

Contributors

The Apache HTTP Server is a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards. Typically Apache is run on a Unix-like operating system, but it is available for a wide variety of operating systems, including Linux, Novell NetWare, Mac OS-X and Windows. Released under the Apache License, Apache is open-source software.