Apache Web Server

19K

Solutions

14K

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

Hi I'm attempting the access the TMDB API using PHP

using the sample script here on my localhost WAMP I get this error

cURL Error #:SSL certificate problem: unable to get local issuer certificate

Open in new window


Running it on a live site works but I don't want to be running test scripts on a website

I have 3 questions

1. How do I solve the SSL certificate problem:?
2. in the CURLOPT_URL line  how do I substitute 'Kate%20Hudson' for $Name?
3. In the output  how do I access the components? I thought it would be $id = $response->{results}{id};

CODE
<?php
error_reporting(E_ALL);
$curl = curl_init();
$Name= "Kate Hudson";
curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.themoviedb.org/3/search/person?include_adult=false&page=1&query=Kate%20Hudson&language=en-US&api_key=2c8a02fa36fb5299dcd97bbc84609899",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_POSTFIELDS => "{}",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
  
  $id = $response->{results}{id};
  $name = $response->{results}{name};
  $profile_path = $response->{results}{profile_path};
  echo "<p>  id  [$id] name  [$name] profile_path [$profile_path]</P>";
}

Open in new window


RESPONSE


Open in new window

0
Does Your Cloud Backup Use Blockchain Technology?
LVL 4
Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

Apache2 quit working when I was messing with the config files and when I purged it and installed it, it quit working.

After I got it working again PHP wasn't working, so I removed it and reinstalled it and it's still not working.

Then I tried to remove PHP and then remove Apache2. I installed Apache2 then installed PHP and it's not working.

From the terminal

Setting up libapache2-mod-php7.1 (7.1.8-2+ubuntu16.04.1+deb.sury.org+4) ...
dpkg: error processing package libapache2-mod-php7.1 (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 libapache2-mod-php7.1
E: Sub-process /usr/bin/dpkg returned an error code (1)
0
I had my Apache2 running good on my development machine.

I changed some site configurations and started running the noip.com's client, even though this is a production machine, to see if I could access it from the world wide web.

I tried to install it in terminal and came across the following error

brian@brian-XPS-13:~$ sudo service apache2 start
[sudo] password for brian: 
Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.
brian@brian-XPS-13:~$ sudo apt remove apache2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apache2-data apache2-utils
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  apache2
0 upgraded, 0 newly installed, 1 to remove and 121 not upgraded.
After this operation, 501 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 278612 files and directories currently installed.)
Removing apache2 (2.4.18-2ubuntu3.4) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for ufw (0.35-0ubuntu2) ...
brian@brian-XPS-13:~$ sudo apt purge apache2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apache2-data apache2-utils

Open in new window

0
I recently upgraded to a new SSL certificate. My old used to include both the www and naked domains (e.g. https://www.chloedog.org and https://chloedog.org).  But the new certificate only includes the naked domain.  

I'm trying to use a .htaccess redirect so that both are accomplished in one pass.  I've tried a few different things and none work.

The most recent was:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.
RewriteRule ^(.*)$ https://chloedog.org/$1 [R=301,L]
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

Open in new window


With the above, the following happens:

http://www.chloedog.org?129  - Works Fine
http://chloedog.org?129 - works fine
https://chloedog.org?129 - works fine
https://www.chloedog.org?129 - I get an "insecure connection" message.

Can you tell me what I'm doing wrong? It is like it looks for the certificate before doing the redirect.
0
Is it possible to block a state via htacess?  Hypothetical, I am not allowed to business in CA so I want to block the state of CA?
Are there instructions on how to block all countries except the USA via htaccess?
0
I created an htaccess file in my directory for pma.fivetier.com with the following:

order deny,allow
deny from all
allow from xx.xxx.xxx.xx

Open in new window


When trying to visit from my IP I get a testing 123... page if you visit link above you will see.   If I remove the .htaccess file I have full access again without any problem.  What am I doing wrong?  Do I need to use ipv6 address or something?
0
In my previous server I wasn't running mod_perl, but in the new environment I'm setting up I need to.  There are some fundamental differences that I need some help with.

In the current environment, I have a lib folder under the cgi-bin directory.  All of my scripts reference it relatively.  
ie.
require "lib/function.lib";

For my packages I just use:
use lib "lib";
use MyPackage;

This works really well for me for a number of reasons.  I have a dev and production environment that are completely identical and completely separate, but living on the same machine.  I can move programs from dev into production at will without having to change anything.  It's made life much easier.

However in mod_perl it doesn't seem to run in the cgi-bin directory but somewhere else entirely.  I'm not sure if it possible to get the same functionality or how to do it.  Any help would be appreciated.
0
The error i get when i use port 21The error i get when i use port 21The error i get when i use port 21I have  this ftp dameon installed on my server for ftp access : psa-proftpd      1.3.5b-cos7.build1205160427.18. I am running centos 7 with a plesk 12.5 control panel. Each time i try to access port 21 with a valid user name and password i get an error. I have a screenshot of the area as an attachment to this question. I have never setup the ftpd dameon, it was installed when plesk was installed. I need help on understanding, do i need to do some manual changes to the config file of this dameon. I have firewalld and a router running, and both allow port 21 access to the real world. What can be the problem here, please help. I even check to see if the port is open from the web and it is. I am sure this issue is not hard, i just am a bit stuck at this point.
0
I have a text box on a php page residing on my apache web server which has the following:
"£300 plus other text lines"

The page is uft-8 encoded
The text "£300" is displayed correctly on my web server - ie the "£" sign comes across correctly
If I send the details of this text box via a php form, the "£300" comes out as "£300"

Can someone explain what is happening and how I can get rid of the £ and replace with £
0
Hi

I'm in the process of building a website it's still at the early stages on a local machine

Is it possible to view this over the internet just with a ip address  or do I need to register a domain?

What steps within windows are there to do this?

I'm running WAMP
0
What does it mean to be "Always On"?
LVL 4
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Have a website.  I am trying to create a test website based on the main website to troubleshoot an issue.  I created the site using FileZilla.  I copied the files from the main site "internal.mysite.com" to "internaltest.mysite.com".

I logged into apache and modified the apache.conf file using "sudo nano /etc/apache2/apache2.conf"

Copied below
<VirtualHost *:80>
   DocumentRoot "/home/webserver/www/internal.mysite.com"
   ServerName internal.mysite.com
   <Directory "/home/webserver/www/internal.mysite.com">
       Require ip 172.16.2.0/24
       Require ip 172.16.10.0/24
       Require ip 172.16.20.0/24
       Require ip 10.0.0.0./255.0.0.0
       Require ip 127.0.0.1
   </Directory
</VirtualHost>

Open in new window


To
<VirtualHost *:80>
   DocumentRoot "/home/webserver/www/internaltest.mysite.com"
   ServerName internaltest.mysite.com
   <Directory "/home/webserver/www/internaltest.mysite.com">
       Require ip 172.16.2.0/24
       Require ip 172.16.10.0/24
       Require ip 172.16.20.0/24
       Require ip 10.0.0.0./255.0.0.0
       Require ip 127.0.0.1
   </Directory
</VirtualHost>

Open in new window


Then hit ctrl+x and then Y for save

Restarted server with "sudo service apache2 restart".

Server restarted successfully.

I can access internal.mysite.com but internaltest.mysite.com returns a DNS error -> can’t find the server at internaltest.mysite.com.

I did the exact same steps to a previous site and it works but this one is not.

I also checked the file permissions and ensured that internaltest.mysite.com matched internal.mysite.com.

Any ideas?
0
Interestingly enough I have no problem using let's encrypt on Windows platform and figured it was going to be a breeze on *nix... Running into a slew of issues.  For one I am trying to use certbot to facilitate this.  When I issue the correct commands and webroot I see it builds the .well-known folder but it does not build the acme-challenge folder.  If I try to manually create the acme-challenge folder it deletes it after the sudo certbot certonly --webroot -w /var/www/example -d example.com -d www.example.com command (with my domain info substituted of course) with the following error:

Detail: Invalid response from
   http://<mysite>/.well-known/acme-challenge/bM6ijKNrbr6Dcf3nzJdyhssFHrySeeLk-2VWQgAlWnQ:
   "<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
   <html><head>
   <title>403 Forbidden</title>
   </head><body>
   <h1>Forbidden</h1>
   <p"
Super frustrated as everything in *nix is always easier, right?  Well not this time LOL.   Any suggestions would be appreciated!

-J
0
I would like all three of these:

http://domain.com
http://www.domain.com
https://domain.com

...to redirect to:

https://www.domain.com

I would like to "keep" anything after the .com, such as:

/page.htm
?script.php?abc-123

I'd also like to keep the domain generic, so I can reuse this code for many websites.

Can it be done? I have seen various examples of parts of this, but haven't found a comprehensive solution.

Thanks!
0
AuthType Basic
AuthName "Auth Required"
AuthUserFile C:/xampp/apache/bin/passwordfile
Require valid-user
# allow public access to the following resources
SetEnvIf Request_URI "(path/to/directory/)$" allow
SetEnvIf Request_URI "(C:/xampp/htdocs/TickTock_int/results_invoices_IDsel_Client.php\.php)$"  allow
SetEnvIf Request_URI "(util)$"  allow
Order allow,deny
Allow from env=allow
Allow from ::1
Satisfy any

Open in new window


I am trying to allow access through my xampp .htaccess file to the referenced php page above
Problem is the .htaccess is still active when I access this page externally
0
Hi!

I hope you are well.

I am having the following issue which I'm hoping someone can help me with.

I am trying to create a wordpress site hosted in my machine and using xampp to do so.

I was successful initially and could start wi¡orking on the site but suddenly the apache service on xampp would not start. I read that this could be resolved uninstalling apache from  the computer with the console and installing xampp again which did resolve it but now I get the following error when I type http://localhost/C:/xampp/htdocs/wordpress/nomind on the browser to biuld the site:

Access forbidden!

You don't have permission to access the requested object. It is either read-protected or not readable by the server.

If you think this is a server error, please contact the webmaster.

Error 403

localhost Apache/2.4.25 (Win32) OpenSSL/1.0.2j PHP/5.6.30

I downloaded wamp and had the same problem, also xampp on another computer I have at home and also had the same issue. I even restored my computer since I did not had the problem initially but it did not help.

Thank you very much in advance for your time and help!!!
0
How would I do the following?

https://www.domain.com/33434343_5443.pdf

RewriteRule ^(.+\.pdf)$ open_pdf_file.php?pdf_file=$1 [NC,L]

Open in new window


However, this rule does not appear to work.
0
I'm running Apache 2.4 and I'd like to see the values being received for some HTTP variables, like HTTP_ACCEPT.   Thanks for any help.
0
I was looking at WordPress. Never used WordPress before. Looking at the Business plan. Is the plan $24.92/monthly or 1 payment of $24.92 for 1 year?

I would like to create a blog Unlimited Storage Space to add videos etc. Kind of like worldstarhiphop

Is there a FREE service somewhere else that supports Unlimited Storage Space? Is there a WordPress alternative that has the features of the Business plan that's free?
0
I need to write a rule in my apache htaccess file to redirect:

/insurance-plans/year/schools/international-student-plans-2015?s=136&l=5000
to:
http://%{SERVER_NAME}/insurance-plans/year/schools/international-student-plans-2017?s=136&l=7000

The rule I wrote is as follows, but it does nothing:

RewriteRule ^insurance-plans\/year\/schools\/international-student-plans-2015?s=136&l=5000$		http://%{SERVER_NAME}/insurance-plans/year/schools/international-student-plans-2017?s=136&l=7000	[R=301,L,NC,NE]

Open in new window


I'd be grateful if someone would show me the correct htaccess code to implement my redirect.

Thanks,
Jon
0
Migrating Your Company's PCs
LVL 4
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Hello experts,

Need some help

We have migrated a website from cpanel accelerated2 to another hosting provider who provided latest version of cpanel. The transfer was successful. However while browsing the website we are seeing below error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@xxxx.com 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.

I have gone through the error logs in cpanel which is logging below error everytime the domain is accessed.

corealert: pid xxxxx /home/xxx/public_html/.htaccess unknown filter provider deflate

At first we though php version 5.4 not installed is the issue, we have installed 5.4 via cpanel and restarted the http webserver but still same error.

Unable to understand where to look for

Any help is appreciated.

Thank you

best regards
0
For rewrite rule in httpd.conf, it seems following condition & rule should apply:
1. If URL contains string "usedirectory=yes"
Rule: Do nothing

Like following:
Original URL:https://conpoc.acme.com/communities/service/html/community/autoCompleteMembers.do?format=v2&includeGroupMembers=yes&includeExternal=no&member=doe.john&usedirectory=yes
Rewrited: No change

2. If If URL contains string ”autoCompleteMembers.do“ and not contains usedirectory=yes
Rule: Append usedirectory=yes to original query string

Like following:
Original URL:https://conpoc.acme.com/communities/service/html/community/autoCompleteMembers.do?format=v2&includeGroupMembers=yes&includeExternal=no&member=doe.john
Rewrited:
https://conpoc.acme.com/communities/service/html/community/autoCompleteMembers.do?format=v2&includeGroupMembers=yes&includeExternal=no&member=doe.john&usedirectory=yes

I tried following but not working

<VirtualHost *:443>
     ServerName conn6.win.com
     SSLEnable
     SSLProtocolDisable SSLv3 SSLv2
     RewriteEngine on

     RewriteCond %{REQUEST_URI} ^/communities/service/html/community/autoCompleteMembers.do
     RewriteCond %{QUERY_STRING} ^(.*)format=v2&member=(.*)$
     RewriteCond %{QUERY_STRING} !usedirectory
     RewriteRule ^/communities/service/html/community/autoCompleteMembers.do(.*) /communities/service/html/community/autoCompleteMembers.do?usedirectory=yes  [R=301,NE,L,QSA]

</VirtualHost>
</IfModule>
0
I want to put a mod_rewrite rule in httpd.conf to handle mobile requests. If the browser on the sending device accepts mobile stuff, I want to rewrite the request to the original file name with an "m_" in front. So if a mobile device sends

https://example.com/51/a1.html
I want to rewrite it to

 https://example.com/51/m_a1.html
I have the lines below now in httpd.conf:

RewriteCond %{HTTP_ACCEPT} "text\/vnd\.wap\.wml|application\/vnd\.wap\.xhtml\+xml" [NC]

RewriteRule ^example.com/([0-9]*)/(.*)$ ^example.com/$1/m_$2
But requests from a mobile device don't get rewritten. Does anyone see the problem?

Thanks
0
Hi Experts

I need an htaccess rewrite rule to redirect from the following URL format:

xyz.com/ABC123

to the following URL format:

http://abc.com/parm?Search.Active=True&Search.SerialType=1&Search.SerialNumber=ABC123&%23=FIND+ASSET

Note that the part marked in bold is a variable that will change. It can contain one to three letters and/or one to three numbers and can be a minimum of 1 character in length and a maximum of 6 characters in length.

What is the rewrite rule that I need please?

Thanks
0
My site httpS://www.mysite.org and, my subdomain http://subdomain.mysite.org  are working fine. My problem is when I forgot to put httpS on mysite.org (Ex.: http://www.mysite.org) the browser goes to  http://subdomain.mysite.org.

How to solve this problem ?
0
I want a tool that will run through our website once daily and send a report of any broken links it finds. I can do it either in VB and use Access 2003 here at the office or I can install it as a php app on our  web server.

Any ideas?
0

Apache Web Server

19K

Solutions

14K

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.