How to access folder without domain and with ip address at WHM Web Host Manager? - cpanel

I have root access, but I do not have domain name. I want to upload project and access through IP address. How is it possible?

That would be possible. Enable mod_userdir in WHM -> Apache mod_userdir Tweak. If userdir protection is enabled them uncheck the protection for the desired cpaneluser and also for the user nobody.
Then access your account like http://server-ip/~cpanelusername

In Windows system hosts files are located in Windows – SystemRoot > system32 > drivers > etc > hosts
By default, the system root is C:Windows, so if you are using Windows, your host's file is most probably: C:\Windows\System32\drivers\etc\hosts
In Linux system hosts files are located in Linux – /etc/hosts
In Mac system hosts files are located in Mac OS X – /private/etc/hosts
For more details please check the link
https://www.blazingcoders.com/how-to-access-hosted-website-files-without-domain-name-or-domain-control

Related

How to remotly access a custom wampserver's virtual host in a local network?

I use Wampserver 3.0.6 under windows 10 and I want to share my application between my personal PC (The host) and some other computers linked to the same home network (Clients).
I changed a line on httpd-vhosts.conf file to let the application be accessible from other machines in the network from this:
Require lacal
to this:
Require all granted
The problem is that the default virtual host (localhost) is accessible from those clients using the host's ip adress like this 192.168.###.###/ but not my customized virtualhost (tilelli on this case). Here is the content of httpd-vhosts.conf file now:
enter image description here
I tried to access it via 192.168.###.###/tilelli/ and directly via tilelli/ but didn't work.
Can anybody help me please ?
If you define a Virtual Host Servername as tilelli then Apache will serve that site when it sees that domain name in the connection request i.e. http://tilelli.
If you have a local (company) DNS Server, add that domain to it, pointing to your WAMPServers PC's IP Address. If you dont have a local DNS Server, then change the HOSTS file on the PC's that need to see this server so they know where to look for it
HOSTS FILE
192.168.xxx.yyy tilelli
You do have to change each and every one of the other PC unfortunately.

Adding a Shared folder also as Document Root

I am running Apache 2.4.41 on Linux Mint 20.
My document root is home/www/.
I have a laptop also connected using Samba.
I would like to add a shared folder also (from the laptop) to the Document Root settings.
How do I do it without removing home/www/?
On your laptop, enable sharing of a folder. Lets say C:\LinuxShare.
On mint, install Samba to mount that folder. Mount it on /mnt/LinuxShare.
When that works...
Identify the user running your Apache. You can start is and do ps -ef | grep httpd, it will show you the user. Or look in httpd.conf, directive User.
Configure the permissions on /mnt/LinuxShare so that the user identified in 3) can read files under that directory. You could use a group, or others permissions (for home it's ok, for corporate network, do not use others!).
When you have validated that the Apache user can read files under /mnt/LinuxShare
In your VirtualHost, add Alias /wwwpc /mnt/LinuxShare
Also add a <Directory /mnt/LinuxShare> section to allow reading that directory.
Restart Apache
on the laptop, put an HTML file (lets say SOMEPAGE.html) in C:\LinuxShare. Make sure you can see it on mint under /mnt/LinuxShare.
on mint, start a browser and try http://localhost/wwwpc/SOMEPAGE.html. You should see the page.
on the laptop, start a browser and try http://THE_IP_OF_THE_MINT/wwwpc/SOMEPAGE.html. Remember that Apache runs on mint, so on the laptop you cannot access it via localhost.

How to configure custom hostname to IP resolutions in my system for web development

Preface
A web app can potentially
serve different pages,
depending on the
hostname
that is requested by the browser,
even if all hostnames are resolved
to the same
IP address.
Example
For example, at
https://app.example.com,
which resolves to
1.2.3.4,
users will find the user interface
and at
https://admin.example.com,
which also resolves to
1.2.3.4,
awaits a dashboard
through which
only the app's owner can
administrate users and data
in the app.
What We Need
In short,
we need to enter,
for example,
http://admin.app:8000/
in our browsers
and have that admin.app resolve to 127.0.0.1.
The Question
How can I configure
custom hostname to IP address resolutions
in my development environment?
(Ubuntu and Derivatives) Configure NetworkManager's dnsmasq
Ubuntu Desktop's default networking configuration is
composed of NetworkManager and its slave dnsmasq.
The slave dnsmasq listens at 127.0.1.1 and /etc/resolv.conf lists it as the only nameserver.
This has
some benefits.
What it means for this purpose is that we have a fully configurable DNS server, comfortably configured by default.
We can create
/etc/NetworkManager/dnsmasq.d/hosts.conf
and put in it whatever address statements we'd like:
address=/admin.app/127.0.0.1
We can even use wildcards!
address=/.app/127.0.0.1
See the
dnsmasq documentation
for details
(look for --address).
Since dnsmasq is started by the network-manager service,
then I would assume that the following would restart it
so that new configuration would take effect:
$ service network-manager restart
But its init-script does not control slave dnsmasq.
Therefore the dnsmasq process must be killed and then
the above command would have it start again.
And that is it!
(Linux) User Specific HOSTALIASES File
Very limited
This would have been my preferred answer
because
it refrains from
altering system configuration.
But:
It does not support wildcards
It does not support hostname to IP address resolution
It does not support freely configurable subdomains
It will not work if you have a local DNS server,
which is the case in modern Ubuntu.
What is It
It is a user specific host aliases file.
Notice that the format is not the same as the hosts file.
In short, you create a file
which contains host aliases.
For example
foo localhost
bar localhost
and place it at ~/.hosts.
Then you set an environment variable
HOSTALIASES
with the path to the aliases file.
So, for this example
$ export HOSTALIASES=~/.hosts
If Testing In a Virtual Machine
In a virtual machine
127.0.0.1 and localhost
will not reach the host,
but the guest.
In VirtualBox, for example,
by default, the host can be reached
at 10.0.2.2.
So, the guest VM's hosts file can look like
10.0.2.2 host
10.0.2.2 app.host
10.0.2.2 admin.host
Proxy DNS Nameserver Inside a Virtual Machine
If you're setting up
a proxy DNS nameserver
inside a virtual machine
(perhaps for wildcard support in Windows)
the upstream nameserver
is usually provided by the host.
In VirtualBox, it is 10.0.2.3.
(Windows) Configuring Acrylic DNS Server
Acrylic DNS Proxy is easy to install and configure.
It can help us get hostnames with aliases quickly in Windows.
And it is open source.
Install it.
Open the hosts file (via the start menu entry).
Put in some entries, like 1.2.3.4 >app.
Clear its cache and restart it (via the start menu entry).
Set your DNS server to 127.0.0.1.
(Windows, Linux, OSX) System Wide Hosts File
Simply edit the
hosts file.
Its location
depends on the OS.
For example:
127.0.0.1 app.localhost
127.0.0.1 admin.localhost
On Windows you can use
this nifty open source GUI
for editing the hosts file:
Hosts File Editor.
Wildcards
The hosts file does not support wildcards!
Ubuntu Desktop
Since Ubuntu 12.04,
Ubuntu desktop comes with
a local DNS server,
which might not respect
the hosts file (/etc/hosts).
So, for Ubuntu desktop, this answer
is best.
(GNU/Linux)
Since all the major distributions are migrating (or already did) to systemd stack the proper place to implement wildcard support would be systemd-resolved: see https://github.com/systemd/systemd/issues/766 for details.
That would be the place to set custom overrides for DNS as well.
As for windows - its VM should just get DNS from host machine: it's to risky to run it on bare metal anyway.

How do I get access to localhost:3000 on OS X on a network using a windows machine?

I used to access localhost:3000 serving up an application via [computername].local:3000
The recent update of Mountain Lion removed Web Sharing
I have installed the Web Sharing preference pane found here http://clickontyler.com/blog/2012/02/web-sharing-mountain-lion/
but alas I'm still not able to access it from Windows XP on ie7
Any thoughts?
In order for other computers to be able to access it, they need to know where it is.
This is where the "hosts" file comes in.
On your Windows XP machine, open up notepad as an administrator. From notepad, click "File" > "Open" in the top menu.
Now open C:\Windows\System32\drivers\etc\hosts
The file should look something similar to what I've pasted below:
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
Now, add the local IP address of your OSX machine with the hostname you want to access it by in the browser. You can find out your Mac's local IP address in the Network preferences pane (instructions can be found here: http://osxdaily.com/2010/11/21/find-ip-address-mac/ )
Example (assuming your Mac's IP on the local network is 192.168.0.100):
192.168.0.100 [computername].local
Save the file. Now your Windows XP machine will know that, in order to access [computername].local, it will need to contact the computer at 192.168.0.100
Assuming your web server is online, and configured to accept connections on port 3000, you can open up a web browser on Windows XP and type http://[computername].local:3000
If you still can't access it, also try the following and update your question with the results:
Temporarily disable the Firewall on OSX. Does this allow Windows XP to access it?
What error message do you get from Windows XP?

symlink or alias? Not sure what its called

I want to redirect request on my local webserver much like "http://localhost/" redirects to my ServerRoot. I have seen it done with "http://www/" and also with "http://helpdesk/" How would I go about adding my own?
Are you saying you want to redirect something like http://custom to your web server? If so you can do this by creating an entry in your hosts file, or configuring your local DNS server to return local addresses for those hostnames.
Add the following to your hosts file (On *nix /etc/hosts and C:\Windows\System32\drivers\etc\hosts on Windows)
127.0.0.1 custom www.custom
Then you can optionally configure a virtual host on your Apache server to handle requests for those hosts. If you don't create a virtual host, it will just serve up the same content as localhost. You can also have your local webserver host the site and add that entry to your local PC's hosts file and be able to browse it from that hostname as well.
If that isn't what you wanted, can you please clarify your question.