http://localhost:80 class not registered - apache

I installed Bitnami wamp stack, and, though my installation is reachable by http:// [nameofmylaptop]/site , i have the following error each time I launch apache :
http://localhost:80
Class not registered
I can't find anything relating to this..
Any help ? Thank you.

Have you tried: localhost/site, it could be that since your website is in a subfolder called site, localhost root directory has nothing to display.
#Husman Yeah it works.
Theres your problem then, there is nothing in the root folder, you can have an apache redirect to take you from localhost to localhost/site, and that should fix your issue.
There are multiple ways to redirect:
use a server side script (index.php)
use .htaccess rewrite rule
RewriteEngine On
RewriteRule ^$ /site[L]
use apache config httpd.conf to redirect from one folder to another
Redirect permanent / http://git.example.com/git/
...

Related

HTTP Post request to aws ec2 directory /opt/lampp/htdocs/donate/ denied

I am trying to make a post request to http://localhost/donate/payment.php".
It works fine when I run the application locally
However when I change the URL to
"http://ec2-xx-xxx-xx-xxx.ap-southeast-2.compute.amazonaws.com/opt/lampp/htdocs/donate/payment.php"
I get page not found error. I can guarantee that the file is present in the location.
I have tried several things like changing the permission of the the /opt file recursively to 777. Also tried changing the apache server port default port from 80.
I even tried placing a .htacces file inside the donate folder to access the server. the contents are
RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain.com
RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^www\.yourdomain\.com$
RewriteCond %{REQUEST_URI} !^/WebProjectFolder/
RewriteRule (.*) /WebProjectFolder/$1
All attempts have failed. Is there anything else I am missing here. I have installed bitnami parse server and I am able to access that by http in the browser. It is present in the folder /apps in the root folder.
Does AWS override any security permissions?
Assuming /opt/lampp/htdocs/is your document root, shouldn't the URL be http://ec2-xx-xxx-xx-xxx.ap-southeast-2.compute.amazonaws.com/donate/payment.php?
You might also want to verify a couple of things:
Make sure your security policy has its inbound port 80 open to the public (or where you'll be visiting from)
Assuming you're using Apache httpd, make sure it accepts connections on the external interface or all interfaces (e.g. Listen 80, Listen 0.0.0.0:80, etc)
First, if you actually get an error from your Apache server, the issue has nothing to do with AWS. If there were misconfigured security groups or NACL, you'd never reach port 80 (http).
Second, never ever chmod -R 777, not only can you break your app behavior, but also, especially with PHP, you just opened security risks. Yes, this doesn't matter until your instance becomes part of a botnet and starts sending spam.
At a glance, I would say your Apache configuration lacks something, like a VirtualHost "any":
# from https://httpd.apache.org/docs/2.4/vhosts/examples.html
<VirtualHost *:80>
DocumentRoot "/www/example1"
ServerName www.example.com
# Other directives here
</VirtualHost>
It seems like your default location points to another directory, possibly the default one.

Remove /public from URL in a subfolder

I'm building a Laravel application, and it will be in a subfolder of a current project. I'm trying to get rid of the /public in the URL, so that the users can view the project at this URL :
www.domain.com/project
instead of the default ...
www.domain.com/project/public
I did some digging on StackOverflow and the Laracasts forum, and I tried this, in a .htaccess file at the root of my project :
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
However, my routes doesn't work anymore when I do this. Even the default route for / stopped working.
A lot of answers mention that the best way is to change the root in the Apache config, so that it serves the files from /public instead of at the root of the directory.
The problem is that this in a subfolder of a main project, how can I make it so that only this project is affected? The website at www.domain.com works fine and does not have a /public in the URL.
There are a couple options. I don't think you want to try fixing this at the htaccess level with mod rewrites (or anything like that)
One option is to create another virtual host that listens on an abitrary port (eg, 8080). Then set the document root for this virtual host to .../public/
Another option, you can spoof the dns in your /etc/hosts or Windows hosts file, and set up a dev.domain.com virtual host.
•Go to mainproject/public>>
a. .htacess
b. favicon.ico
c. index.php
d. robots.txt
e. web.config
1.cut these 5 files from public folder,and then paste on the main project folder that’s means out side of public folder… mainproject/files
2.Next after paste ,open index.php ,modify
•require __DIR__.'/…/bootstrap/autoload.php'; to
•require __DIR__.'/bootstrap/autoload.php';
modify
- $app = require_once DIR.'/../bootstrap/app.php'; to
- $app = require_once DIR.'/bootstrap/app.php';

apache2 - RewriteRule just change the name

I have a folder with content in it. URL to it: http://www.example.com/something/
Is it possible now to rewrite the URL to this: http://www.example.com/learning/?
If yes, how?
Note: Folder something has some subfolders and a lot of HTML and PHP Files, including CSS and JS stuff.
Second note:: I can just edit my httpd.conf
Edit:
I'm using apache2 and jboss. apache2 just for the proxy and rewrite module. So my jboss application can be reached at this location: http://www.example.com:1231/something/.
I just defined that the jboss application ca be reached under port 80 at this url http://www.example.com/something/.
Now i wanna do the redirect like above.
This should work:
RewriteEngine On
RewriteRule ^/something(.*) http://www.example.com:1234/learning$1 [P]

url rewriting on localhost

I have WAMP installed on my local machine. I have configured the apache module for rewrite_mod and trying a very basic example to redirect
RewriteEngine on
RewriteRule ^alice.html$ bob.html
As per this rule when I hit alice.html I should be viewing bob.html content. But, I think the url rewriting is not effective.
I have /test folder placed under www and alice.html and bob.html both are place inside the test folder.
Any advice to resolve this.
Thanks
This is resolved.
Did you enable the mod_rewrite module for Apache ? You need to enable this module for using rewrite directives. Don't forget to restart Apache after enabling the module.

How to configure apache (ubuntu) such that www.mysite.com will direct to www.mysite.com/drupal6/?

I am a newbie to ubuntu and apache. Can someone tell me how I could direct to
www.mysite.com/drupal6
when user address www.mysite.com?
Thanks a lot.
Cheers.
If you are running Apache and Ubuntu, there is actually a really easy way to force this redirect using a simple php script.
Create an index.php file in the root of your server and paste the following code into it
<?php header("location: drupal6/") ?>
This will cause the site to auto-redirect to the drupal6 folder whenever it is visited.
This should work. Create a file in the root folder of your server called .htaccess - the dot at the beginning is very important as this helps the server identify the file as a hidden / system config file.
Open the file and paste the following lines of code in :
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ www.mysite.com/drupal6/$1 [R,L]
This should force all traffic to the server to redirect to your custom folder.
A brief explanation of the .htaccess code
If you want rewrites to work, you have to enable the Rewrite Engine and tell the server to follow symlinks.
The second section establishes the rule - specifically applying it to all traffic on the standard web port of 80.
The final line tells the server to grab everything after the URL and append it to the new address (mysite.com/drupal6).
There's a lot more you can do with .htaccess files but you really need to Google for good examples to test out.
Look at Apache's mod_rewrite documentation. You will need a RewriteRule in your apache configuration at the minimum, you may also need RewriteCond's to define when the RewriteRule is used.
Your rewrite pattern will be rewriting the REQUEST_URI with something from: ^/$ to: /drupal6. The ^ and $ are essential to prevent Apache getting into an infinite loop while rewriting the base URI by only matching "/" and not "/anything-else".
I assume you're on a recent version of Ubuntu and Apache? If so, see the Apache 2.2 documentation on mod_rewrite.