can't access wamp projects online - mysql

A lot of similar questions to mine,, but really none addresses my issue!
I installed Wamp on a pc (win 7) connected to internet and i gave it a real IP (78.10*..) in which i can access it anywhere.
i did the following:
changes in httpd & phpmyadmin,, (deny all replaced with allow all) (server name "localhost:80" replaced with my public ip 78.10*..:80) ( denied replaced with granted) (added ::1)
changes in phpsysinfo, sqlbuddy,webgrin (requier local host removed ,, deny from all replaced with allow from all)
-put wamp online from its icon
-firewall is turned off
-full permission granted on local hard C and put on shared too
when i request 78.10*.. on another computer (not in my LAN) the wamp index previewed and i can access Tools(phpinfo, phpmyadminn) & Your Aliases(phpmyadmin, phpsysinfo, sqlbuddy, webgrin) but i can't access my project which located in the www directory
when i press on project named "m" a redirect page previewed and redirected me to page named localhost and says page not available, if i did same thing on my server the redirected page redirect me to localhost and i can access my project
any help will be appreciated
Thanks in advice

Change (wwwroot='localhost') to 78.10*.***.*** in your "Config.php" inside your Moodle folder.
To make your moodle folder your root directory, do the following:
You will have to edit two things inside of the httpd.conf file /wamp/apache2/conf/httd.conf find:
DocumentRoot "/wamp/www"
change to
DocumentRoot "your_moodle_folder"
then find:
<Directory "wamp/www">
change to
<Directory "your_moodle_folder">
Save it and restart apache.

Related

Forbidden Error When Running WP Theme in MAMP PRO

I cloned a private repository for a WordPress theme. The repository includes a wp-content folder (plus five other files - .png's, an .ico, and an .md). I'm trying to run the contents of this repository - the WordPress theme - locally on my Mac using MAMP PRO.
Running the repository should look like this: http://dynamic.switzercreative.com/
But I'm getting this:
In MAMP PRO, I have Apache and MySQL running:
You can also see that MySQL is configured to use port 8889.
Going into phpMyAdmin --> Database Name (on the left side) --> Privileges
I make sure that the username matches what I have in the wp-config.php file, and it does (line 3):
define( 'DB_USER', 'database_username' );
I also notice that under privileges, 'Grant' is set to no for this username. I'm guessing I need to edit this?
Should I be editing username privileges - is that what's causing this error message?
EDIT: I went ahead and hit "edit privileges" and checked "grant" under administration. That made the username display "all privileges", just like the other usernames
But I'm still getting the forbidden error message when typing localhost:8888/theme_name_wpe into the URL.
EDIT 2: I also considered that this might be a permissions issue. I followed the instructions in the second answer of this article - I cd'd into homefolder/wp-content/themes and ran sudo chown -R username:groupname theme_name to hopefully give the theme its necessary permissions. I'm still getting the same result in the browser, though.
EDIT 3: After checking the error log, I saw that the error message said:
Failed to load resource: the server responded with a status of 403 (Forbidden)
That led me to this article. Following the instructions in the top-rated answer, I cd'd into the root directory (the folder 'dynamictransit_wpe' that's sitting on my Desktop) and ran the following commands:
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
I'm still getting the same error, but the error message looks different now - like this:
Was I supposed to cd into the theme folder? (dynamictransit_wpe --> wp-content --> themes --> theme)
EDIT 4: After googling '403 forbidden httpd - t', I found this article, which suggests that I need to edit the httpd.conf file. At line 150 in the file, I found:
User #-1
Group #-1
I thought that I would need to change these to match the Database username / group name, but these changes this yielded no effect. I also tried a variety of other User and Group possibilities, including setting User to the Username for my Mac - still nothing.
A 403 means that something about the server's configuration is blocking your access to that particular file. In your case, since you are trying to access the site, the file is going to be index.php
From everything I can see in your documentation above, you already have WP installed correctly and the only potential problems I see are:
MAMP may not be running it's own Apache server. I say MAY because I don't have enough information to make that determination but it is a possibility.
Your Apache configuration forbids access to your web root. Did you create a folder specifically for this app in MAMP? If so, make sure that the root folder has 755 permissions and is owned by the web server's user and group.
Check your httpd.conf file and make sure that AllowOverride is set to All.
Ensure you don't have a funky .htaccess file somewhere that is blocking access to your site. When in doubt, rename the file to something like htaccess.txt and see if your site loads.
I'm not exactly sure which one of these adjustments caused it to work, but now going to "localhost/" renders the website:
1.) Changed username and password in wp-config.php to "root", like this:
define( 'DB_USER', 'root' );
define( 'DB_PASSWORD', 'root' );
(MAMP / MAMP PRO automatically sets "root" as the username and password for a database, so make sure that they are set correctly)
2.) Also make sure that the database name, host, home, and siteurl match:
define( 'DB_NAME', 'dynamic_transit' );
define( 'DB_HOST', 'localhost' );
define('WP_HOME','http://dynamic');
define('WP_SITEURL', 'http://dynamic');
3.) Make sure that the host name is set to localhost:
4.) Create an .htaccess file within your root folder (the folder that contains wp-content, wp-admin, and wp-includes. Leave that file blank.
5.) Make sure the username for Ports --> "Run Servers As:" is set to the username for your computer:
6.) Restart servers and go to localhost/ in the URL. If it's a WordPress site you should be able to go to localhost/wp-admin and enter your WordPress username and password to login.

Have index.html file but still getting a directory listing

I have an index.html file in my Apache DocumentRoot directory but when I go to my URL, I am still getting a directory listing of my DocumentRoot directory instead of the index.html file being displayed. The apache access_log shows 200's when I reload the page. Any suggestions?
Use
DirectoryIndex index.html
It tells apache what document to show for a directory request.
update
You should specify just the filename that apache will look for in the folder requested.
Not saying this will fix it for you, but for me when first getting started with Apache2 it was file permissions that would get forgotten when moving or writing new file under the web root directory
ls -hal /var/www/host_one/index.html
If above doesn't have read (r) permissions for the same user:group or if the ownership doesn't include the user/group of the web server, then try the following for allowing group reads
# Modify ownership, change 'www_host' to Apache2 group
chown ${USER}:www_host /var/www/host_one/index.html
# give read+write (6) to user and read (4) to group owners
chmod 640 /var/www/host_one/index.html
Try refreshing the website and see if permissions where the issue. Note most web documents only require read permissions and ownership to be correct for browsers to be allowed to pick them up for rendering, on rare occasions you may need executable (1 or x) permissions for server scripts (be cautious of ownership in such cases) and last write permissions (2 or w) should likely never be seen without good reasons on files within your web root.
Second thing to try, use the index.html within your browsers URL bar
# by IP
http://192.168.0.100/index.html
# by domain
http://site-name.local/index.html
If the above loaded your document then, like #Pekka 웃 stated already, you've likely got a server option that's missing or enabling directory listings instead of looking for a index page within that directory. If this is the problem then there's two ways of fixing it that I've tried in the past. One, htaccess configuration to disable directory listing within that sub-directory, two, server vhost configuration to prevent whole site from directory listings. Personally I prefer to use option two and then on directories that should be allowed to be listed place an htaccess config for permissions instead of denials.

make public website reconnect to local html or xampp

Basically what I want to do is if I open this
http://steamcommunity.com/market
website on my pc I want to see a local website that is stored as html. I already tried to host the website with xampp which worked and trying to add
localhost/path http://steamcommunity.com/market
to my hosts file.
but instead of redirecting me to my local hosted html file it just loaded the steam market.
This is a two step process: first, you have to redirect the web site name to your computer; next, you get Apache to redirect the web site address to your installed directory.
Locate your hosts file,
Add lines containing the domain name(s) and IP address to redirect to.
Each line must begin with the address 127.0.0.1 (this is the localhost address)
After the IP address, type the name of the domain you wish to redirect to this address. You may only enter 1 name per line.
Addresses like my-site.com and www.my-site.com are different and each need a separate line.
Save the changes.
Next,
Locate the httpd-vhosts.conf file. For most XAMPP 1.7.3 installs this will be C:\xampp\apache\conf\extra
Add the new host,
<VirtualHost *:80>
ServerName www.joomla.16
ServerAlias joomla.16
DocumentRoot d:/xampp/htdocs/path/mysite
</VirtualHost>
Explanation of VirtualHost preparation,
ServerName: following this label, add the name of the domain you added in
ServerAlias: following this label, you may add as many alternate domains (separated by spaces) as you like that are supposed to resolve to this virtual host. Remember that www.my-domain.com is different from my-domain.com, but, typically, you would want them to resolve to the same server.
DocumentRoot: following this label, add the path where your website is located. You can use an absolute path (as in the example above), or a relative path (but relative paths can be trickier to set up, so I prefer to use an absolute path).
Restart Apache Web Server
You should now be able to type the domain name into your URL field and go directly to your locally hosted web site:
Please see this tutorial for more help.
No idea why you'd wanna do this, but your hostsfile should be:
127.0.0.1 www.steamcommcunity.com
::1 www.steamcommcunity.com
127.0.0.1 steamcommunity.com
::1 steamcommunity.com
Just to be on the safe side I've used both with and without www, and both IPv4 and IPv6

Photos are not showing up when using No-IP ddns and linux apache

I don't have a static IP address so a person recommended that I use no-ip.com
I did and now my website is accessible from external internet yay
The problem now is that my photos aren't showing, I thought this would have been a simple issue
I'm not sure if I have to do something with Virtual Host or...
My domain name is greenace92.ddns.net
I can access my index.html file, that shows up fine but the photos aren't showing
On my httpd.conf file I have
ServerRoot "/usr/local/apache2"
The html files are in htdocs under apache2
So, on virtual host that httpd-vhosts.conf file I have the following
ServerAdmin "jacobcun#ricekidengineer.com"
DocumentRoot "/usr/local/apache2/"
ServerName "www.greenace92.ddns.net"
*ricekidengineer.com is my other domain with email configured
I didn't change the error logs from stuck "dummy" stuff
So on my html file for image href's I have
http://www.greenace92.ddns.net/htdocs/images/normalbus-icon-on.png
I assume that www.greenace92.ddns.net is /usr/local/apache2
So I'm just continuing the directory location
Is that correct? What is wrong?
Yeah I don't understand, I even tried three different directories for a few photos, trying directly in apache2, then htdocs, then the images folder
What am I not seeing?
You will have to decide what your want as the domain for your site:
www.greenace92.ddns.net is not setup for your web site
greenace92.ddns.net is the domain setup for your web site.
You either have to
configure no-ip.com to point to the domain www.greenace92.ddns.net
(or)
change your apache ServerName directive to
ServerName "greenace92.ddns.net"
and change the image URLs in your HTML pages from something like
http://www.greenace92.ddns.net/htdocs/images/normalbus-icon-on.png
to
http://greenace92.ddns.net/images/normalbus-icon-on.png
Note: With your current configuration, the 2nd URL mentioned above should already work (It worked when I tested!).

XAMPP + OSX + Virtualhosts + change user in httpd.conf = phpmyadmin create database not working

I have installed XAMPP on OSX Lion.
Because I want to serve a folder from one of my development folders I have added a virtualhost to /Applications/XAMPP/xamppfiles/etc/extra/httpd-vhosts.conf
<VirtualHost *:80>
ServerAdmin email#gmail.com
DocumentRoot "/Users/myosxUsername/Documents/dir/dir/htdocs"
ServerName qmh
ErrorLog "logs/qmh-error_log"
CustomLog "logs/qmh-access_log" common
</VirtualHost>
and also added an entry to the hosts file
127.0.0.1 qmh
Because of permission issue with the server accessing the directory /Users/myosxUsername/Documents/dir/dir/htdocs I have also changed the user in httpd.conf to my myosxUsername
User myosxusername
Group admin
# previous setting below
# User nobody
# Group nobody
After those changes virtual hosts work fine.
The problem is that when i now use phpmyadmin to create a new database i get the error message
db_create.php: Missing parameter: new_db
if I change the user back to:
User nobody
Group nobody
then phpmyadmin works fine, but my virtualhost directory cannot be accessed due to permission issue.
I assume I somehow have to tell apache to not use the new user for mysql access somehow? Your help is appreciated. Thanks
See item 2.8 from phpMyAdmin FAQ (http://wiki.phpmyadmin.net/pma/FAQ_2.8)
In the php.ini directive session.save_path and upload_tmp_dir, if these directories don't exist, are read-only or not accessable (f.e.
due to base_dir restrictions) this error will occur. See trk
PHP installed from a packages (eg. an rpm) might set the permissions on these directories for an assumed user (eg. 'apache'). -
Users of other web servers, eg Lighttpd, may need to change the
ownership of these directories (eg. to 'lighttpd').
On Windows, if PHP is using directories for session.save_path and upload_tmp_dir that are somewhere within the main "Temp"
directory, you must create those directories yourself; unlike other
Windows programs PHP will not create them itself.
If you are using Hardened-PHP (/suhosin patch) with the ini directive varfilter.max_request_variables set to the default (200) or
another low value, you could get this error if your table has a high
number of columns. Adjust this setting accordingly ( request limits,
thanks to Klaus Dorninger for the hint).
In config.inc.php, try to leave the $cfg['PmaAbsoluteUri'] directive empty. See also FAQ 4.7.
Maybe you have a broken PHP installation or you need to upgrade your Zend Optimizer. See http://bugs.php.net/31134.
In the php.ini directive arg_separator.input, a value of ";" will cause this error. Replace it with "&;".
(tip from https://serverfault.com/questions/385465/phpmyadmin-missing-parameter)