Jump to content

mstdmstdd

Members
  • Posts

    146
  • Joined

  • Last visited

Recent Profile Visitors

2,593 profile views

mstdmstdd's Achievements

Advanced Member

Advanced Member (4/5)

0

Reputation

  1. Could, you please provide an example or a link to such file ?
  2. I searched how to install multiple projects on nginx server and found some articles, like https://medium.freecodecamp.org/how-you-can-host-multiple-domain-names-and-projects-in-one-vps-7aed4f56e7a1 I added new server block with rather long server name(which I created in freenom) Checking the syntax I got error that server_names_hash_bucket_size must be set to 64 I tried to set and and did not find valid place for it. I found that it must be added under http block. I tried to add http block in my /etc/nginx/sites-available/default but got syntax error : $ sudo nginx -t nginx: [emerg] "http" directive is not allowed here in /etc/nginx/sites-enabled/default:22 nginx: configuration file /etc/nginx/nginx.conf test failed My /etc/nginx/sites-available/default : ## # You should look at the following URL's in order to grasp a solid understanding # of Nginx configuration files in order to fully unleash the power of Nginx. # https://www.nginx.com/resources/wiki/start/ # https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/ # https://wiki.debian.org/Nginx/DirectoryStructure # # In most cases, administrators will remove this file from sites-enabled/ and # leave it as reference inside of sites-available where it will continue to be # updated by the nginx packaging team. # # This file will automatically load configuration files provided by other # applications, such as Drupal or Wordpress. These applications will be made # available underneath a path with that package name, such as /drupal8. # # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples. ## # Default server configuration # http { server_names_hash_bucket_size 64; } server { listen 80 default_server; listen [::]:80 default_server; # SSL configuration # # listen 443 ssl default_server; # listen [::]:443 ssl default_server; # # Note: You should disable gzip for SSL traffic. # See: https://bugs.debian.org/773332 # # Read up on ssl_ciphers to ensure a secure configuration. # See: https://bugs.debian.org/765782 # # Self signed certs generated by the ssl-cert package # Don't use them in a production server! # # include snippets/snakeoil.conf; # root /var/www/VotesDeploy/public; root /var/www/html; # Add index.php to the list if you are using PHP index index.php index.html index.htm index.nginx-debian.html; server_name ec2-rather-long-name.us-east-2.compute.amazonaws.com; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.2-fpm.sock; } location ~ /\.ht { deny all; } # pass PHP scripts to FastCGI server # #location ~ \.php$ { # include snippets/fastcgi-php.conf; # # # With php-fpm (or other unix sockets): # fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; # # With php-cgi (or other tcp sockets): # fastcgi_pass 127.0.0.1:9000; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } server { listen 80; root /var/www/votes/public; index index.php index.html index.htm index.nginx-debian.html; server_name rather-long-name-demo.demo-apps.tk; location / { try_files $uri $uri/ /index.php?$query_string; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.2-fpm.sock; } location ~ /\.ht { deny all; } access_log /var/www/votes/storage/logs; # server_names_hash_bucket_size 64; } # Virtual Host configuration for example.com # # You can move that to a different file under sites-available/ and symlink that # to sites-enabled/ to enable it. # #server { # listen 80; # listen [::]:80; # # server_name example.com; # # root /var/www/example.com; # index index.html; # # location / { # try_files $uri $uri/ =404; # } #} Which is valid syntax ? Thanks!
  3. Thank you for the link, but with quick review I did not find how to create multiple websites under one server?
  4. Hello, If there is a way to import all mailchimp lists from one account to other? If yes, how? Thanks!
  5. looks like the problem was that in security group i forgot set httphttps access If there is a way to set Multiple Websites on Single instance with nginx ?
  6. Hello, I installed Ubuntu 18 instance under AWS and I found this article with nginx installation(I used this article with installation in Ubuntu 18 under Digital Ocean) https://devmarketer.io/learn/deploy-laravel-5-app-lemp-stack-ubuntu-nginx/ I installed nginx, but I am not sure whioch must be servwer name in nginx configurations : server { listen 80 default_server; listen [::]:80 default_server; root /var/www/html; index index.php index.html index.htm index.nginx-debian.html; server_name ec2-NN-NN-NN-NN.us-east-2.compute.amazonaws.com; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.0-fpm.sock; } location ~ /\.ht { deny all; } where my Publick DNS NN-NN-NN-NN.us-east-2.compute.amazonaws.comI checked nginx syntax and restarted php and nginx $ sudo nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful $ sudo systemctl restart php7.2-fpm $ sudo service nginx restart But running url http://NN-NN-NN-NN.us-east-2.compute.amazonaws.com/I got error: But not nginx greeting page. Is it on AWS different and what did I miss? Thanks!
  7. I read file content $filename = '0001.jpg'; $filename_content= file_get_contents($filename_path); $appMailchimp= new appMailchimp(); $newMailChimpFile=$appMailchimp->addFile($filename, $filename_content); and public function addFile( $file_name, $file_data ) { $is_debug = true; $url = $this->m_base_url .'file-manager/files' ; $fileInfo = [ 'name' => $file_name, 'folder_id'=> 5673, 'file_data'=> $file_data ]; echo '<pre>-2 addFile $url::'.print_r($url,true).'</pre>'; if($is_debug) echo '<pre> -1 addFile $fileInfo::' . print_r( $fileInfo, true ) . '</pre>'; $ch = curl_init( trim($url) ); curl_setopt( $ch, CURLOPT_USERPWD, 'user:' . $this->m_mailchimp_api_key ); curl_setopt( $ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json' ] ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); curl_setopt( $ch, CURLOPT_TIMEOUT, 10 ); curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, "POST" ); curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode( $fileInfo ) ); $newFile = json_decode( curl_exec( $ch ) ); var_dump($newFile); and error : and output : http://imgur.com/a/ggRQO
  8. Yes, $fileInfo was defined before cURL call, in the same scope. I also tried to use file_get_contents for - but the same error. But file_get_contents for - also returned string? I thought the right way was to get bytes from image and for that I used fopen($file_name, "rb"); If there is a way to set example image as image text ? I mean just any small image just to check if the error was in wrong data format ?
  9. Hello,Making adding of files to mailchimp as it is written here: https://developer.mailchimp.com/documentation/mailchimp/reference/file-manager/files/ I do like : $ch = curl_init( $url ); curl_setopt( $ch, CURLOPT_USERPWD, 'user:mykey' ); curl_setopt( $ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json' ] ); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); curl_setopt( $ch, CURLOPT_TIMEOUT, 10 ); curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'POST' ); curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); curl_setopt( $ch, CURLOPT_POSTFIELDS, json_encode( $fileInfo ) ); $newFile = json_decode( curl_exec( $ch ) ); $fileInfo = [ 'name' => $file_name, 'folder_id => 5673, 'file_data'=> $file_data ]; $file_name - is name of file like '0001.jpg', 5673 - id of folder and $file_data is content of file I read using lines like $fd = fopen($file_name, "rb"); $contents = fread($fd, filesize($file_name)); fclose($fd); $url is https://us7.api.mailchimp.com/3.0/file-manager/files I got error [message] => Schema describes object, NULL found instead I am sure tha $url - is right and it has value - I get list of files using GET method for $url https://us7.api.mailchimp.com/3.0/file-manager/files What can the resason of this error? Is it wrong format of source file ? Thanks!
  10. Hello,In my products store site with many categories of products I need to give possibility for users to become subscribersfor some categories. I suppose that any categories of products must correspond to List ID of mailchimp List I found example like http://www.codexworld.com/add-subscriber-to-list-mailchimp-api-php/ It uses List ID and that is clear. The question is if there is a way to retrieve from mailchimp listing of all List ID(key and title)?I looked some examples, but did not find a way to make it ... Thanks!
  11. Hello, In WordPress/WooCommerce application I need to make that if some user is not logged by clicking on link to open popup dialog and login in it. Are there some examples/pluging to make it : on successfull login redirect to homepage on failure to show error to prepose to login again. I would prefer code sample as I need to implement it in my own popup dialog. Thanks!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.