i have a website with Joomla 2.5.4, in the configuration file the DB host is coded as localhost. i know the DB name, username, password to access. But not the URL to access the Host. is that Possible to get the information without logging in to C PANEL etc..
in some situations my client fails to give me the url to access DB, if iopen the configuration file, there it says LOCALHOST.
Is there any other way to find out?
If the configuration.php has localhost then it should be the same as the website/the ip address of the website. Remember 'localhost' is just a synonym for the current computer.
I'm not sure why you would want the URL though.
If you're writing a software extension for Joomla! you don't need the database details you can just get the database object from the framework, eg. $db = JFactory::getDBO();
If you writing a PHP script external to Joomla! you can just use localhost in your connection code e.g..
$mysqli_connection = new MySQLi('localhost', 'user', 'pass', 'db');
To check for errors in the connection you would the check the value in $mysqli_connection->[connect_error][2]
If you want to do a remote connection then the websites address will generally do if the configuration states localhost (obviously if it doesn't have local host or an equivalent then the value will be the database servers address), but you will also need to setup the remote access through cPanel.
I'm afaid you cannot find this information in other way than through your webhost, at least not to my knowledge.
localhost is the most usual way, but there are most likely other host adresses like: mysql.yourhost.com or by ip: 123.456.456.7
I also faced same problem. I left the host name as 'localhost' when the files are in the file server. Then it works fine for me. If its not working fine for you,just put your domain name instead of localhost (or) otherwise file hosting service provider needs to provide the details of host name when you signup.
Related
For work at the moment i need access from localhost of my computer (with Codeigniter) to DB into a server hostinger.
How can make it? How can change the configuration of phpmyadmin? I only want connect with my codeigniter to a remote DB.
I also accept a good server that permise me allow remote connection.
Secure and Unsecure base url has been set to http://xx.xx.xx.xx/magento/. Where xx.xx.xx.xx is my LAN IP. So ecommerce magento site works fine in my local machine with above mentioned URL.
and my LAN IP is NAT with global IP yy.yy.yy.yy.
When I launch my magento ecommerce site with global ip( http://yy.yy.yy.yy/magento/) , it route correctly to local ip url (http://xx.xx.xx.xx/magento/) but fails to launch with following error.
Oops! Google Chrome could not connect to xx.xx.xx.xx/magento/.
Please let me know the fix for this issue.
Note: Global ip is pinging withput any issue .
Also I tried to launch global url from outside my LAN Network.
I can also access just http://yy.yy.yy.yy (WAMP server info)
You need to do following steps:
Open phpmyadmin.
Open core_config_data table.
Change value for value column to http://yy.yy.yy.yy/magento/ where path = web/secure/base_url and path = web/secure/base_url.
I hope you are able to understand my point.
I am curious about Amazon webservices and so I thought of creating a dynamic webpage with Amazon EC2. I created an instance, installed apache and php and made sure it is working in EC2(using remote access). I have assigned a elastic IP to the instance. My question is how to access the webpage that I created in the instance. I am not sure what to give the servername in httpd.conf. My goal is access the page like http://amazonaddress/test.php
I am using windows server, but I think it is basically the same. My documents are in the same folder as mentioned in conf file. But when I use my elastic IP, it isn't working . Not even the basic index page in the apache htdocs(that's the home folder according to conf). To throw more light I will explain what I have done till now.
I have created a micro instance(EC2) and logged into it using remote desktop. I have installed apache msi file and php after that. I have created a elasticIP and attached the instance and to my security group I have added http service to port 80. I have tested if localhost is working in my remote machine(points to index.html). After that I have tried accessing it using elastic IP and it just times out. Is there any step I have missed?
You can access it via http://255.255.255.255 where you replace the 255.255.255.255 with your elastic IP address.
Then you want to setup DNS for your domain name. So you'll need to create an A Record mapping www.yourdomain.com to whatever your elastic IP address is. You can usually do this via your domain name registrar as most of them also run basic DNS services for free.
You can access an ec2 instance using it's public DNS name (or elastic IP since you already have one of those), which can be seen in the instances description tab. Configuring your personal domain name to point to that server will involve creating an A Record mapping to that public IP.
Assuming apache has been setup correctly, that's all you should need to do to get started (and your test.php page is in /var/www/). For your purposes, you probably shouldn't even need to modify the httpd.conf file at all.
Also, be sure to remember to open a port on the security group (under Network & Security from the EC2 Console) that the instance belongs to. In your example, you will want to open port 80 inbound with source 0.0.0.0/0 (unless you want to limit access to a specific IP range).
Hope this helps.
I have seen a few related questions on SO, but none have helped me. I setup a MySQL database on an Ubuntu machine on EC2. I am trying to connect to it from within R, using e..g ,
con <- dbConnect(MySQL(), username = user, dbname = db, host = host, password = password)
where the username and password are those for the remote database, and the host is the ec2 address (something like ec2-54-456-161-6.us-west-2.compute.amazonaws.com [not a real one])
Any thoughts on how to do this?
To log in to the Ubuntu machine the database is installed on from the shell on my machine I have to use the key pem file. Does this key have to be provided to authenticate? If so, how?
Make sure the MySQL instance listens on the network, even if you're on the same machine. In /etc/mysql/my.cnf, change this:
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
This should be in a number of MySQL tutorials and is not EC2 specific.
You want to make sure that you can connect to the DB from the server itself. Once that is taken care of, try the remote access. If a port ends up being blocked, you can also got the route of an ssh tunnel -- which again is described in a number of tutorials.
The problem in my case was that I just need to add a new rule to the security group to allow remote connections on port 3306. See below screenshot of the rule added (the bottom line)
That was all that was needed.
Is there any difference between the following when a intranet URL in accessed in IE
Add an entry in drivers/etc/host file for a name and IP
vs
Use IP directly
e.g. it works with the following link if I have a host entry as (XYZ 10.0.10.200)
http://XYZ/SiteDirectory/ABC/Default.aspx
but when I tried to use IP instead of name
http://10.0.10.200/SiteDirectory/ABC/Default.aspx
It gives me 404 not found error
Yes, there's a difference.
The web server is using HTTP/1.1 and "shared virtual hosting". When the client connects it sends an additional Host: header which contains the hostname part of the URL that the user supplied.
The web server looks at the header to find out which virtual host's data to serve.
In this case, the web server is configured to recognise and serve content from the "XYZ" domain, but doesn't know about any domain called 10.0.10.200
Smells like the webserver is using virtual hosts, so that it serves different pages if the client went to "www.foo.com" or "www.bar.com", even though they have the same IP-address.
As far as I can see there should be no difference. With a host name the order is hosts file before DNS so it should be used.
Is there another line in the host file with the same hostname?
What happens when you do a tacert? (trace route)