MAMP Multiple hosts, php versions, and ddns - php

I'm using MAMP Pro v4.4 on an iMac running High Sierra. I need to provide remote access to sites. The document root is htdocs for all my sites. I use no-ip.com for DDNS. It all works fine. Locally and remote, no problem.
I'm trying to setup another host and eventually assign it another version of PHP if I can get that far. I don't know what I'm missing but I just don't get it. I follow the docs. Create the new host name and choose the document root folder which is in the htdocs folder.
For example, on my local machine it works fine. http://testhost:8888 resolves properly. But http://other.ddns.net:8888/testhost does not. In fact none of the ddns works now even the ones that had been working.
Not sure what I'm missing? Or doing wrong? Thanks for any suggestions.

Related

Using laravel in a subdirectory, without root access

A year ago, I decided to go with codeigniter instead of laravel, because codeigniter prooved to be easier to setup. I am now preparing for my next project and it seems as if codeigniter is now obsolete (at least most of the people seem to recommend laravel over codeigniter).
Now to my problem: I use a virtual ubuntu machine for developing web apps so I have a dev environment similar to the production environment (this helps me to avoid some problems (especially case-sensitivity...;)))
I installed composer and laravel and created a new laravel project named "quickstart" in /var/www/quickstart. I then followed their "getting started guide" (here: Guide). So far everything worked.
But here come the problems:
I have two other web applications in /var/www, so when I enter the ip of the machine I see the 3 directories.
Issue 1:
Normaly I'd expect that as soon as if I click on the "quickstart"-Directory in my browser, the webapp would get displayed, but I have to click a second time on "public", and then the webapp is displayed.
Issue 2: Of course, the links on the page are wrong too, because they reeer to (for example) "/task", which can't be found on the server.
The problem is that I'm not really experienced with apache configuration. I suspect it has something to do with VirtualHosts, but AFAIK you need to have root access to configure virtual hosts, and I do not have root rights on the dev environment.
Could you point out a way to me how I can make laravel work in a subdirectory in a way that I can just move the files and folders to my hoster as soon as I have finished the project? I'd like to then change only one file, and not all paths and URLs in all files ;)
Regards,
Christian
Thanks to Bogdan, I was able to figure it out. My hoster allows symlinks, so I did it like so:
I put the laravel installation in
/srv/web/quickstart
(quickstart is the name of the project). I then created the following symlink:
ln -s /srv/web/quickstart/public /srv/web/www/public
The document root of the apache is configured to
/srv/web/www/public
After that I just got a blank page. That was because I forgot to set the correct permissions on the storage-folder. So I set the following permissions
chmod -R 777 /srv/web/quickstart/storage
This is fine for a development environment. For production I'd recommend to only allow the webserver-user to write into that directory.
And voilĂ : Everything works!
Thank you for your help bogdan.
Christian

Live site is an ubuntu, setting up wamp on local machine var/www not resolved

I have a live site that is set up using ubuntu. All my files include a bunch of classes and they are all referenced at var/www/classes/class_name. My file structure is a lot different being on a wamp server.
I don't want to have to go through all my files and change the location to match that of the windows machine.
Is there an easy way to make my wamp server look in a windows directory structure when my php file says to look in var/www?
I don't want to have to go through all my files and change the location to match that of the windows machine.
You should be using relative paths anyway so that this isn't a problem. I strongly suggest going back and fixing your paths so that you can move your code to wherever it needs to be.
I have a live site that is set up using ubuntu.
You should be running your development code in an environment similar to where it will run in production. I suggest using a tool like Vagrant to manage a virtual machine for you that runs Ubuntu and whatever web server you run in production. When you do this, you can also map directories over in any way you like. (You should still solve your path problem though.)

Setup existing Yii project on xampp linux

I need to edit an existing yii app but got no idea how to setup in xampp.
I downloaded everything from the server and moved the folders to /opt/lampp/htdocs
But then i got no idea how to get the application running.
When i try
/localhost/yiidirectory
It shows me the file structure so the app isn't executing.
Can you give me some advise to accelerate the problem solving ?
Since windows 7 I believe you need to use:
http://127.0.0.1/yiidirectory
If that doesn't work then check your xampp setup:
http://www.yiiframework.com/wiki/100/yii-and-xampp-server-on-windows/
The DNS resolver just hands back localhost so it never resolves it for the app/browser.

Laravel 4 on IIS7 not working

I am developing and learning laravel on my local host running wamp. Everything works fine on local host, but when i copy everything to my shared IIS7 host i get an Internal server error.
Everything works fine untill $app->boot(); in 'vendor\laravel\framework\src\Illuminate\Foundation\start.php'.
I tried giving all folders all permissions but that didn't solve the problem.
I don't have composer installed on my shared host, because i believe i could just copy all the code from my local host, to the shared host, and only had to convert the .htaccess to Web.config (and these files work like they should). This worked when i was working with CodeIgniter, and everything was just copy/paste.
Does anyone know what is wrong and how i can solve this?

Problem with new files on Ubuntu Server on VBox

I have a virtual machine (VirtualBox) running latest ubuntu server as my personal/development web server.
My configuration is the following:
My web server (running Zend Server CE) is running on the virtual machine.
My files, are on my host machine (Win7) and all the virtula machine does is to serve the files from a shared folder.
So if I go to /home/ronaldo/htdocs/project_name I can see all my files for that project - the shared folder in this case is the main folder - htdocs.
I use VirtualHost - so every new project has an address such as project_name.local.
Every now and then, when I add new files to a project - say, using Dreamweaver, PHPDesigner or even Internet explorer, that file is not recognized on the server.
It was working fine.
I think my last major change was to upgrade the server to the latest some weeks ago I think.
Now, lets say I'm working on an Opencart ecommerce project and I am creating a new module, with controllers, views, etc. The new files are not recognized until I reboot my server.
When I try to list the files on my web-server using "ls" - the new files appear in red.
Why is that?
Anyone has a similar setup or can help me with a workaround not to have to reboot the server.
Unmount/Mount the shared folder : http://www.virtualbox.org/manual/ch04.html#sf_mount_manual
You may get more specific help at virtualbox forums.
Or if it is an option, you can create a windows share and use that from Linux.

Categories