How to create pre url subdomains using MAMP Pro - mamp

I am using MAMP to develop a site and I wanted to know if there is a way to create pre url subdomains from within the software itself. IE http://subdomain.mywebsite.com
I want to stay away from all the complexity of messing with apache config if possible but if there is no other way than that's fine.
Thank you.

MAMP do not provide the possibility to create hosts. But you can use MAMP PRO to create hosts with any name you want. You can also add aliases to host with any name you want.

Related

How can i change PHP ini values in mamp pro for single host?

I need to develop a website for a server that has PHP short tags set to OFF
Is it possible to set this option only for one host in MAMP PRO (4)?
I believe that Mamp Pro uses one php.ini file for all sites but you may be able to work around this by enabling PHP Short Tags via your .htaccess on a site-by-site basis.

yii2 remove backend/web and frontend/web from url

I am trying to change site url from http://localhost/yiiwebsite/backend/web/index.php url to http://localhost/yiiwebsite/admin and http://localhost/yiiwebsite/frontend/web/index.php url to http://localhost/yiiwebsite/.
Can anyone help me to do this.
It's described in official docs here.
Here is some basic info:
The application installed according to the above instructions should
work out of box with either an Apache HTTP server or an Nginx HTTP
server, on Windows, Mac OS X, or Linux running PHP 5.4 or higher. Yii
2.0 is also compatible with facebook's HHVM. However, there are some edge cases where HHVM behaves different than native PHP, so you have
to take some extra care when using HHVM.
On a production server, you may want to configure your Web server so
that the application can be accessed via the URL
http://www.example.com/index.php instead of
http://www.example.com/basic/web/index.php. Such configuration
requires pointing the document root of your Web server to the
basic/web folder. You may also want to hide index.php from the URL, as
described in the Routing and URL Creation section. In this subsection,
you'll learn how to configure your Apache or Nginx server to achieve
these goals.
By setting basic/web as the document root, you also prevent end users
from accessing your private application code and sensitive data files
that are stored in the sibling directories of basic/web. Denying
access to those other folders is a security improvement.
If your application will run in a shared hosting environment where you
do not have permission to modify its Web server configuration, you may
still adjust the structure of your application for better security.
Further configuration depends on chosen web server (Nginx / Apache), which is not even mentioned in the questoin. But both options are covered in official docs by the given link.
For shared hosting environment there is special section too.
And by the way this was asked before many times here on SO, just do a better research.

Create server panel like cPanel

I have a VPS, Cent OS 6.4 64bit
I want to create a panel (like cPanel) and I want to make it accessible by opening a port (serverip:2082 for example). I have created php files of my own panel but i don't know anything about linux services.
What type of code must I make and where can I put it?
Thank you in advance!
no offense, but if you really don't know about linux service you are 99% away from creating your own panel. You first need to understnad that Cpanel not only modify system files to allow hosting and managing database, but it also do all these without playing with system security.
But to start you need a web server that will host your Cpanel. I prefer it to be different from your webserver that host your website, reason? What if your default apache is inaccessible or crash, your panel will crash with it. Then you need to learn Mysql, or database you want to manage through panel, DNS binding, Name servers, regular expression to manage text files of configuration etc.
I know all these because I already built a Cpanel like application, and know it is not easy job especially with this level of question you asked.

Connecting Coda to local Wordpress install hosted with Mamp Pro

I have been using Coda and regular version of Mamp for local development for longtime without getting into this permission mess. I recently, upgraded to Mamp Pro and setup it with VHosts. I have a site example.com with it's root path set to /Users/john/Sites/example. I have set the owner and group to www in Mamp Pro.
The moment I got all this configured I started having problems with Coda. It keeps asking me the username and password to edit the local files at /Users/john/Sites/example. I guess I have to enable FTP on my Mac and then add a site in Coda to stop it asking me to enter username password for every single file. However, I have no idea on how to get this working. I am using Lion 10.7.2
Additionally, I have setup etc/hosts file for pointing example.com to 127.0.0.1
UPDATE: Though the accepted answer by #mini does not directly answer this question. It is still an elegant solution with seamless integration with Coda.
Consider using DesktopServer instead (along with Coda 2). Unlike MAMP, you can work on template theme files directly with WYSIWYG preview, LAN share for mobile device testing (with WordPress, -not just HTML sites), enables AirPreview to work with WordPress, copy, import/export to live sites, etc. Setup is easy as it manages your vhosts, database, and project files in about three mouse clicks:
http://www.youtube.com/watch?v=Pw9-F8etBPY

Facebook API Integration: testing on different URL?

I'm trying to develop a website which uses Facebook Connect for authentication and other things. However, it seems that FBConnect in general requires the URL of the website to be the same one as you registered the app with. This is a problem, because although I'm running the site at
www.example.com
i am testing the site at
localhost:9000
So all the facebook stuff breaks on my local machine. Currently I'm simply working around this by doing testing on the actual server. So each time I want to test my code after doing stuff, I perform a
// local machine
git commit -a
git push origin master
// remote server
git pull origin master
Which apart from being annoying to do for every small change, is obviously going to be a problem when real people are actually reaching the website, and I want to continue development & testing without breaking it over and over while people are using it.
Is there a better way of doing this sort of thing? I'm sure others (i.e. everyone else who has ever used FBConnect) have run into this problem before. Is it possible to trick my DNS to point www.example.com at localhost during testing, so the Facebook Javascript is tricked to continue working?
One way around this is to edit your system's hosts file to point your domain to localhost. Add a line like this to your /etc/hosts file (or %SystemRoot%\system32\drivers\etc\hosts on windows):
127.0.0.1 www.yourdomain.com
Another approach is to create a second app on facebook for you in-development version, and use localhost as the URL for that version. Just don't forget to update the app id and secret to the production version when you deploy :)
The real answer here is to set up a staging server not located on your own localhost and create a staging application in FB pointing to that staging URL.
I like to use an entirely separate server for this purpose so I can develop and experiment at will without worrying about crashing my production application due to an errant loop or something.
--or--
Create a subdomain (staging.example.com) and stick a clone of your code in a separate root folder with the same directory structure as your application.
Yes, you will need some small conditional code to determine if you're looking at the staging or the production version of your site and then call the appropriate FB keys accordingly.
I ran into this problem when trying to move my code from development (localhost) to production. I was able to use localhost as the canvas url and my production domain for the secure canvas url. That way I was able to