I have 2 websites i want to host on a Linux machine using Apache server. Since at this point i am unable to acquire a domain name, i access the server through IP, since I'm not required to have one yet.
The first site is comprised of a few HTML pages and is located in /var/hostroot/lifeonearth/{all files here} and the other is comprised of several PHP pages located in /var/hostroot/webDarts/{all files here}.
By default when i go to my IP address, it takes me to the default "Your Apache server is working" page. So from here on, how do i make it so that i can access each site through some sort of subdomain like lifeonearth.(my IP) or webDarts.(my IP) or, am I supposed to access them throug different ports. If it's the latter, how do I go about it?
Linux server subdomains for multiple sites
800 Views Asked by IneptusMechanicus At
1
There are 1 best solutions below
Related Questions in PHP
- php Variable name must change in for loop
- register_shutdown_function is not getting called
- Query returning zero rows despite entries existing
- Retrieving *number* pages by page id
- Automatically closing tags in form input?
- How to resize images with PHP PARSE SDK
- how to send email from localhost using codeigniter?
- Mariadb max Error while sending QUERY packet PID
- Multiusers login redirect different page in php
- Imaginary folder when I use "DirectoryIterator" in PHP?
- CodeIgniter + XDebug: debug only working in the main controller, index() function
- PHP script timeout when I use sleep()
- posting javascript populated form to another php page
- AJAX PHP - Reload div after submit
- PHP : How can I check Array in array?
Related Questions in LINUX
- How do I recursively find and replace only in files named index.php on Linux webserver?
- passing text with \n as one argument in shell
- kernel module does not print packet info
- How to send ESC/POS commands to thermal printer in Linux
- (x64 Nasm) Writeline function on Linux
- How do I set the Hive user to something different than the Spark user from within a Spark program?
- Default priority of thread with SCHED_FIFO
- Calling a python function with options from shell script
- How to split a directory into parts without compressing or archiving?
- Cross compile simple standard C program on Linux for Mac
- How to offload NAPI poll function to workqueue
- python netifaces - How to get currently used network interface
- Unexpected output from function
- mingw-64 conflicting declarations when cross-compiling
- Different behavior of async with Visual Studio 2013(Windows8.1) and GCC 4.9(Ubuntu14.10)
Related Questions in APACHE
- .htaccess redirect 403 error files to 404 error document
- RestApi server code is not workinng
- Convert Apache VirtualHost to nginx Server Block for Dynamic Subdomains
- Looking the Method that MANUALLY INSTALL PHP on OSX Yosemite
- Premature end of script on VPS
- Rasterization with Javascript looks different on Apache server
- Vagrant - Ansible error installing Apache
- Can't use subdomain in Chrome using Apache (XAMPP)
- Django webapp (on an Apache2 server) hangs indefintely when importing nltk in views.py
- Redirect keystone app to sub directory using htaccess
- How can I integrate Solr5.1.0 with Nutch1.10
- Disconnect Client connected to cgi application
- Solr ping taking time during full import
- How to redirect an incoming request to specific serverName to different server in apache2?
- What is the correct way to link Django Flatpages?
Related Questions in SUBDOMAIN
- About HTTP_HOST & PHP_SELF
- JavaScript's document.cookie does not replace cookie in the subdomain
- How to see our shop URL in webkul magento extension
- HAProxy Redirects Of Domain & Domain w/Subdomains
- Sub domain "www" not showing up on sub domain url
- Symfony2 + FOSUserBundle + few subdomains
- Redirect website to another website if blocked in particular region
- Regex: How to expand regex for domain name to include domains of type a.b.c.d?
- 301 redirect from subdomain to domain using Plesk
- Steering assistance subdomain, How should .htaccess
- Htaccess adding contents of shared file system in url
- .htaccess redirect everything
- Multiple subdomains to same address
- multi stores in magento root directory not correct
- How to route meteor app dynamically on x.myapp.com where x is dynamic?
Related Questions in WEB-ACCESS
- I cannot access to Pentaho server from remote PC
- Making windows run only one program visible to the user
- Jquery and WAI ARIA
- Access Database exceeds 5000 items and doesn't function in SharePoint because of that
- Google Sheets F# Access and XML
- How to use python to create account on a website?
- dataset of intrusion detection for apache log
- Web access HTML file in my Gitlab repo
- Accessing web interfaces not possible
- web based access to a list of files outside tomcat directory
- How to set different web authentication mode for different database in Lotus Domino
- GetResponse keeps throwing page not found exception
- Amazon Linux AMI Apache User and Permission Web Directory
- Access to two factor authentication sharepoint wesite with python
- Linux server subdomains for multiple sites
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
We have 2 website names.
Now Lets create two files called
example1andexample2in/etc/apache2/sites-available.example1file looks like as followsas the same way create another file called
example2and modify the following linesand
rest of the file will same as
example1.Then enable those two sites
Then do apache service restart.
Now we have to do DNS pointing
If your Linux machine is LOCAL then go to your Windows machine where you want to access these websites and open the following file
C:\Windows\System32\drivers\etc\hostsand mention your ip and website name
Thats it! If you found any difficulties please let me know.
I have replicated this scenario at my end and it works for me. Hope it will work for you!