Apache server 2.4.7 - linux

While I am running my first program in Apache /2.4.7 (ubuntu) it shows error as Follows:
Not Found The requested URL /hello was not found on this server. Apache/2.4.7 (Ubuntu) Server at 127.0.0.1 Port 80.
I tried changing apache2.conf as below:
Options ExecCGI Indexes
FollowSymLinks <------
AllowOverride None
Require all granted
AddHandler cgi-script .py <--------
Still not able execute my program ?
Thanks

Based on the little info provided, there are a couple things to try:
Seems like you are trying to load a Python script, so include the extension of the script filename in the URL. As in: http://127.0.0.1/hello.py
Check for owner and permissions for the script. Does Apache have access to execute them?

Related

Apache configuration 2.4

I need to perform the following configuration on my Apache server, version 2.4, with CentOS system.
The instructions I received are as follows:
Configuring Another Web Server to Serve the Files If another web
server is using port 80 on the same server as Centova Cast, you will
need to use this method.
This method depends upon your knowledge of the other web server you
are using; you must be familiar enough with your web server of choice
to configure it appropriately. Centova Technologies cannot provide
support or assistance with any changes to your web server's
configuration.
To allow "Let's Encrypt" to validate your domain ownership, you must
configure your web server such that any requests for files under the
following URI (replacing example.com with your own domain name):
http://example.com/.well-known/acme-challenge/ ...are configured to
serve files from the following directory:
/usr/local/centovacast/etc/ssl/acme-challenges/ So for example, if you
create a file called
/usr/local/centovacast/etc/ssl/acme-challenges/test.txt, you should be
able to visit http://example.com/.well-known/acme-challenge/test.txt
in your browser and see the contents of the test.txt file.
A few example configurations are provided below. Please note, however,
that differences in your web server configuration may require
additional settings not mentioned here.
Example apache:
Alias /.well-known/acme-challenge /usr/local/centovacast/etc/ssl/acme-challenges
<Directory /usr/local/centovacast/etc/ssl/acme-challenges>
Options None
AllowOverride None
Apache 2.x
<IfModule !mod_authz_core.c>
Order allow,deny
Allow from all
</IfModule>
Apache 2.4
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
</Directory>
I've tried everything and I can't get it to work, how should the correct configuration be done?
My configuration file is located at: /etc/httpd/conf/httpd.conf

403 Forbidden on PHPMyAdmin in Puppy Linux

I have installed XAMPP in TahrPup. I need this for a class, but being the only one who runs Linux I can't get help from others in class or the instructor.
I'm getting a 403 Forbidden error accessing 127.0.0.1/phpmyadmin/ and localhost/phpmyadmin, or even just trying to access 127.0.0.1 and localhost.
Version: XAMPP for Linux 5.6.3-0
I did check that Apache and MySQL and stuff is started (running xampp start).
I have tried based on other answers editing httpd-xampp.conf under <LocationMatch ... to say
Order deny,allow
Deny from all
Allow from ::1 127.0.0.0/8
Allow from all
And in httpd.conf it says
<Directory "/opt/lampp/apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
... this was already the configuration, and most answers said to change it -to- this, which it already was.
I can post config files if needed. I'm just to the point of not knowing where to start anymore.
As stated here:
Why can't I access Xampp's phpmyadmin on localhost? Access is forbidden.
The lines
Order allow,deny
Allow from all
needed to be removed. Okay.

new Symfony project on apache server needs mod_rewrite code?

I have just created a new (test) symfony project and set my apache webroot to /home/user/project/ (not sure if it should be /home/user/project/web/?)
However, from what I understand based on the lightbulb section here: http://symfony.com/doc/current/book/page_creation.html#the-web-directory - there isn't any internal rerouting occurring. Therefore, this does not work:
http://localhost/random/10
but these do work:
http://localhost/app_dev.php/random/10
http://localhost/app.php/random/10
To double check, if I start the internal PHP server (php app/console server:start) then everything gets rerouted correctly - this does work:
http://localhost:8000/random/10
Am I right in thinking that I need to make changes to .htaccess? If so, is there a 'standard' section of code for using apache with symfony?
EDIT:
I have updated my apache2.conf (which for others would be httpd.conf if not on ubuntu as I understand it) as below:
<Directory /home/user/Project/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
If I remember correctly, .htaccess alredy defines DirectoryIndex as app.php. However, your Apache config file httpd.conf might be blocking the override.
Make sure that you have that line in your .htaccess and also check the value of AllowOverride (docs) within your httpd.conf. Try setting AllowOverride to All and see if that works.

Laravel (on Linux, EC2) routes won't work

I have Laravel finally configured (for the most part) on my linux EC2 instance, but right now I can't get to any routes past my home page. All I get back is that *.net/people is not on the server. Anybody have any tips?
If you are using apache, check if your .htaccess is working. For example add 'deny from all' line at the beginning of file. If not - check your httpd.conf. Find <Directory /> block, if there is AllowOverride None line, change it to AllowOverride All and restart your apache.

Web server not reading .htaccess file

I have Ubuntu 12.10 with apache2 installed, and my .htaccess file is not working. I have it set up to be able to not have .php file extensions in the links, so it looks like www.website.com/login instead of /login.php, but it says that the URL "/login" is not found on the server. I have read this page and it says something about "AllowOverride All" but I don't know where that is, or if I need to add it, where I would add it.
EDIT: I have found this link and have found what it says, but it says that I have an Internal Server Error on any page I go to. I have changed the to
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
but it says Internal Server Error
EDIT #2: In the error log, it says
/var/www/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
EDIT #3: Found the answer here: .htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
Make sure you have enabled mod_rewrite in your .htaccess.
Also make sure you these lines at the top of your .htaccess:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
i.e. turn the MultiViews options off.
Also see this Q&A for a similar problem and my answer.
You should have or specify Directory-block in your apache configurations. You can find AllowOverride documentation here: http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride
And documentation about <Directory> is here: http://httpd.apache.org/docs/2.2/mod/core.html#directory
In short: specify where you would like to allow the settings to be overridden with <Directory /path/to/your/directory> and then use AllowOverride all in that directory block.

Resources